2026-07-23 10:11:24 +00:00
// Module ID: 5423
2026-07-27 11:26:19 +00:00
// Function ID: 46472
2026-07-20 16:05:17 +00:00
// Name: getFormattedString
2026-07-23 10:11:24 +00:00
// Dependencies: [5406, 5359, 31, 5424, 5356, 5425]
2026-07-20 16:05:17 +00:00
// Exports: useBenchmark
2026-07-23 10:11:24 +00:00
// Module 5423 (getFormattedString)
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 getFormattedString ( js ) {
js = js . js ;
let averageFPS ;
if ( null != js ) {
averageFPS = js . averageFPS ;
}
const js2 = js . js ;
let minFPS ;
if ( null != js2 ) {
minFPS = js2 . minFPS ;
}
const js3 = js . js ;
let maxFPS ;
if ( null != js3 ) {
maxFPS = js3 . maxFPS ;
}
let str = "" ;
const combined = "Results:\n\nJS FPS: Avg: " + averageFPS + " | Min: " + minFPS + " | Max: " + maxFPS + "\n\n" ;
if ( js . suggestions . length > 0 ) {
const suggestions = js . suggestions ;
const mapped = suggestions . map ( ( arg0 , arg1 ) => "" + arg1 + 1 + ". " + arg0 ) ;
const _HermesInternal = HermesInternal ;
str = "Suggestions:\n\n" + mapped . join ( "\n" ) ;
}
return combined + str ;
}
function runScrollBenchmark ( arg0 , arg1 , arg2 ) {
return _runScrollBenchmark ( ... arguments ) ;
}
2026-07-23 10:11:24 +00:00
async function _runScrollBenchmark ( arg0 , arg1 , arg2 , arg3 ) {
let closure _0 = arg0 ;
2026-07-20 16:05:17 +00:00
let horizontal ;
2026-07-23 10:11:24 +00:00
if ( arg0 . current ) {
horizontal = arg0 . current . props . horizontal ;
let current = arg0 . current ;
2026-07-20 16:05:17 +00:00
if ( current ) {
const size = current . getWindowSize ( ) ;
const size2 = current . getChildContainerDimensions ( ) ;
const diff = size2 . width - size . width ;
const diff1 = size2 . height - size . height ;
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 = { } ;
if ( horizontal ) {
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 , diff , diff1 , arg2 , arg1 ) ;
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 , diff , diff1 , 0 , 0 , arg2 , arg1 ) ;
}
}
}
2026-07-23 10:11:24 +00:00
( { useEffect : closure _4 , useState : closure _5 , useCallback : closure _6 , useRef : closure _7 } = result ) ;
2026-07-20 16:05:17 +00:00
export const useBenchmark = function useBenchmark ( arg0 , arg1 ) {
2026-07-23 10:11:24 +00:00
let closure _0 = arg0 ;
let closure _1 = arg1 ;
2026-07-20 16:05:17 +00:00
if ( arguments . length > 2 ) {
if ( undefined !== arguments [ 2 ] ) {
let obj = arguments [ 2 ] ;
}
2026-07-23 10:11:24 +00:00
let tmp3 = first ( callback3 ( false ) , 2 ) ;
first = tmp3 [ 0 ] ;
const callback2 = tmp3 [ 1 ] ;
callback3 = callback5 ( null ) ;
2026-07-20 16:05:17 +00:00
const items = [ arg1 , arg0 , first , , ] ;
( { repeatCount : arr [ 3 ] , speedMultiplier : arr [ 4 ] } = obj ) ;
2026-07-23 10:11:24 +00:00
let tmp8 = callback4 ( ( ) => {
2026-07-20 16:05:17 +00:00
if ( ! first ) {
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
const dependencyMap = [ ] ;
if ( cancellable . current ) {
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 ) ;
( ( ) => {
let closure _0 = obj ( async ( ) => {
2026-07-20 16:05:17 +00:00
let tmp9 ;
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 tmp6 = outer3 _2 ;
let num2 = outer3 _2 . speedMultiplier ;
let tmp3 = outer4 _9 ;
let tmp4 = cancellable ;
let tmp5 = lib ;
2026-07-20 16:05:17 +00:00
if ( ! num2 ) {
num2 = 1 ;
}
let tmp7 = yield tmp3 ( tmp4 , tmp5 , num2 ) ;
num = num + 1 ;
2026-07-23 10:11:24 +00:00
let tmp8 = outer3 _2 ;
tmp9 = outer3 _2 . repeatCount || 1 ;
2026-07-20 16:05:17 +00:00
} while ( num < tmp9 ) ;
}
const stopAndGetDataResult = jSFPSMonitor . stopAndGetData ( ) ;
if ( stopAndGetDataResult . averageFPS < 35 ) {
2026-07-23 10:11:24 +00:00
let arr = outer2 _1 . push ( "Your average JS FPS is low. This can indicate that your components are doing too much work. Try to optimize your components and reduce re-renders if any" ) ;
2026-07-20 16:05:17 +00:00
}
2026-07-23 10:11:24 +00:00
arr = outer2 _1 ;
let current = cancellable . current ;
2026-07-20 16:05:17 +00:00
if ( current ) {
2026-07-23 10:11:24 +00:00
current = cancellable . current . props . data . length < 200 ;
2026-07-20 16:05:17 +00:00
}
if ( current ) {
arr = arr . push ( "Data count is low. Try to increase it to a large number (e.g 200) using the 'useDataMultiplier' hook." ) ;
}
2026-07-23 10:11:24 +00:00
const obj = { js : stopAndGetDataResult , suggestions : outer2 _1 , interrupted : lib . isCancelled ( ) } ;
2026-07-20 16:05:17 +00:00
if ( ! lib . isCancelled ( ) ) {
2026-07-23 10:11:24 +00:00
obj . formattedString = outer4 _8 ( obj ) ;
2026-07-20 16:05:17 +00:00
}
2026-07-23 10:11:24 +00:00
dependencyMap ( 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
callback4 = tmp8 ;
callback2 ( ( ) => {
2026-07-20 16:05:17 +00:00
if ( ! obj . startManually ) {
let num = obj . startDelayInMs ;
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 ( ) ;
}
} ;
}
} , [ ] ) ;
obj = { startBenchmark : tmp8 , isBenchmarkRunning : first } ;
return obj ;
}
obj = { } ;
} ;
export { getFormattedString } ;