decord/source/5428_runScrollBenchmark.js

152 lines
4.5 KiB
JavaScript
Raw Normal View History

2026-07-23 10:11:24 +00:00
// Module ID: 5428
2026-07-25 08:10:48 +00:00
// Function ID: 46508
2026-07-20 16:05:17 +00:00
// Name: runScrollBenchmark
2026-07-23 10:11:24 +00:00
// Dependencies: [5406, 5359, 31, 5424, 5356, 5425, 5423]
2026-07-20 16:05:17 +00:00
// Exports: useFlatListBenchmark
2026-07-23 10:11:24 +00:00
// Module 5428 (runScrollBenchmark)
import asyncGeneratorStep from "asyncGeneratorStep";
import _slicedToArray from "_slicedToArray";
import result from "result";
let closure_4;
let closure_5;
let closure_6;
let closure_7;
const require = arg1;
2026-07-20 16:05:17 +00:00
function runScrollBenchmark(arg0, arg1, arg2, arg3) {
return _runScrollBenchmark(...arguments);
}
2026-07-23 10:11:24 +00:00
async function _runScrollBenchmark(arg0, arg1, arg2, arg3, arg4) {
let closure_0 = arg0;
let c1;
if (arg0.current) {
const props = arg0.current.props;
2026-07-20 16:05:17 +00:00
let horizontal;
if (null != props) {
horizontal = props.horizontal;
}
2026-07-23 10:11:24 +00:00
const BooleanResult = Boolean(horizontal);
c1 = BooleanResult;
2026-07-20 16:05:17 +00:00
let num = 0;
if (BooleanResult) {
2026-07-23 10:11:24 +00:00
num = arg1;
2026-07-20 16:05:17 +00:00
}
let num2 = 0;
if (!BooleanResult) {
2026-07-23 10:11:24 +00:00
num2 = arg1;
2026-07-20 16:05:17 +00:00
}
function scrollNow(arg0, arg1) {
let tmp = arg1;
2026-07-23 10:11:24 +00:00
const current = ref.current;
2026-07-20 16:05:17 +00:00
if (null != current) {
const obj = {};
2026-07-23 10:11:24 +00:00
if (c1) {
2026-07-20 16:05:17 +00:00
tmp = arg0;
}
obj.offset = tmp;
obj.animated = false;
current.scrollToOffset(obj);
}
}
2026-07-23 10:11:24 +00:00
let obj = outer2_0(outer2_1[3]);
2026-07-20 16:05:17 +00:00
yield obj.autoScroll(scrollNow, 0, 0, num, num2, arg3, arg2);
2026-07-23 10:11:24 +00:00
const obj2 = outer2_0(outer2_1[3]);
2026-07-20 16:05:17 +00:00
yield obj2.autoScroll(scrollNow, num, num2, 0, 0, arg3, arg2);
}
}
2026-07-23 10:11:24 +00:00
({ useCallback: closure_4, useEffect: closure_5, useRef: closure_6, useState: closure_7 } = result);
2026-07-20 16:05:17 +00:00
export const useFlatListBenchmark = function useFlatListBenchmark(arg0, arg1, arg2) {
2026-07-23 10:11:24 +00:00
let closure_0 = arg0;
let closure_1 = arg1;
let asyncGeneratorStep = arg2;
const tmp = isBenchmarkRunning(callback4(false), 2);
isBenchmarkRunning = tmp[0];
const callback2 = tmp[1];
const callback3 = startBenchmark(null);
2026-07-20 16:05:17 +00:00
const items = [arg1, arg0, isBenchmarkRunning, , , ];
({ repeatCount: arr[3], speedMultiplier: arr[4], targetOffset: arr[5] } = arg2);
2026-07-23 10:11:24 +00:00
startBenchmark = callback2(() => {
2026-07-20 16:05:17 +00:00
if (!isBenchmarkRunning) {
2026-07-23 10:11:24 +00:00
const Cancellable = callback(5424).Cancellable;
2026-07-20 16:05:17 +00:00
const prototype = Cancellable.prototype;
const cancellable = new Cancellable();
closure_5.current = cancellable;
2026-07-23 10:11:24 +00:00
if (cancellable.current) {
if (cancellable.current.props) {
const data = cancellable.current.props.data;
2026-07-20 16:05:17 +00:00
let length;
if (null != data) {
length = data.length;
}
if (Number(length) <= 0) {
const _Error = Error;
2026-07-23 10:11:24 +00:00
const error = new Error(callback(5356).ErrorMessages.dataEmptyCannotRunBenchmark);
2026-07-20 16:05:17 +00:00
throw error;
}
}
}
2026-07-23 10:11:24 +00:00
callback2(true);
(() => {
2026-07-20 16:05:17 +00:00
let closure_0 = callback(async () => {
let tmp13;
2026-07-23 10:11:24 +00:00
const jSFPSMonitor = new lib(5425).JSFPSMonitor();
2026-07-20 16:05:17 +00:00
jSFPSMonitor.startTracking();
let num = 0;
if (0 < tmp2) {
do {
2026-07-23 10:11:24 +00:00
let tmp4 = cancellable;
let tmp5 = outer3_2;
let targetOffset = outer3_2.targetOffset;
let tmp6 = lib;
let num2 = outer3_2.speedMultiplier;
let tmp3 = outer4_8;
2026-07-20 16:05:17 +00:00
if (!num2) {
num2 = 1;
}
let tmp7 = tmp4;
let tmp8 = targetOffset;
let tmp9 = tmp6;
let tmp10 = num2;
let tmp11 = yield tmp3(tmp4, targetOffset, tmp6, num2);
num = num + 1;
2026-07-23 10:11:24 +00:00
let tmp12 = outer3_2;
tmp13 = outer3_2.repeatCount || 1;
2026-07-20 16:05:17 +00:00
} while (num < tmp13);
}
const obj = { js: jSFPSMonitor.stopAndGetData(), suggestions: [], interrupted: lib.isCancelled() };
if (!lib.isCancelled()) {
2026-07-23 10:11:24 +00:00
obj.formattedString = lib(5423).getFormattedString(obj);
const obj3 = lib(5423);
2026-07-20 16:05:17 +00:00
}
2026-07-23 10:11:24 +00:00
outer3_1(obj);
outer3_4(false);
2026-07-20 16:05:17 +00:00
});
return function runBenchmark() {
return callback(...arguments);
};
2026-07-23 10:11:24 +00:00
})()();
2026-07-20 16:05:17 +00:00
}
}, items);
2026-07-23 10:11:24 +00:00
callback3(() => {
if (!asyncGeneratorStep.startManually) {
let num = asyncGeneratorStep.startDelayInMs;
2026-07-20 16:05:17 +00:00
if (!num) {
num = 3000;
}
const timeout = setTimeout(() => {
2026-07-23 10:11:24 +00:00
outer1_6();
2026-07-20 16:05:17 +00:00
}, num);
return () => {
clearTimeout(closure_0);
2026-07-23 10:11:24 +00:00
if (outer1_5.current) {
const current = outer1_5.current;
2026-07-20 16:05:17 +00:00
current.cancel();
}
};
}
}, []);
return { startBenchmark, isBenchmarkRunning };
};