import { BenchmarkFunction } from '../types/BenchmarkFunction' ; import { BenchmarkSetup } from '../types/BenchmarkSetup' ; import { compare } from '../../lib/comparisons/typeAware/compare' ; import { randomObjectWithDepth } from 'zufall' ; const name = 'compare large objects' ; let testObjectLeft = { } ; let testObjectRight = { } ; const getNewTestObject = function ( { scale } ) : any { return randomObjectWithDepth ( 3 , Math . round ( scale ** ( 1 / 3 ) ) ) ; } ; const setup = function ( { scale } ) : void { testObjectLeft = getNewTestObject ( { scale } ) ; testObjectRight = getNewTestObject ( { scale } ) ; } ; const benchmark = async function ( ) : Promise < void > { compare ( testObjectLeft , testObjectRight ) ; } ; const scales = [ 100 , 200 , 300 , 400 , 500 , 600 , 1000 ] ; const unit = 'object keys' ; export { benchmark , name , scales , setup , unit } ;