import { BenchmarkFunction } from '../types/BenchmarkFunction' ; import { BenchmarkSetup } from '../types/BenchmarkSetup' ; import { compare } from '../../lib/comparisons/typeAware/compare' ; import { randomObject } from 'zufall' ; const name = 'compare large arrays' ; let testArray = [ ] ; const setup = function ( { scale } ) : void { testArray = Array . from ( { length : scale } ) ; for ( let i = 0 ; i < scale ; i ++ ) { testArray [ i ] = randomObject ( ) ; } } ; const benchmark = async function ( ) : Promise < void > { compare ( testArray , testArray ) ; } ; const scales = [ 100 , 200 , 300 , 400 , 500 , 600 , 1000 ] ; const unit = 'array items' ; export { benchmark , name , scales , setup , unit } ;