@lexborisov
@xeioex
After the recent changes, I've noticed a 3x performance slowdown in this test.
Reason:
>> var a = Array(10**6).fill(1);
undefined
>> console.time(); a.reduce((x) => x, 0); console.timeEnd();
default: 38.690147ms
undefined
>> console.time(); a.reduce((x) => x, 0); console.timeEnd();
default: 39.083297ms
undefined
>> a.length
1000000
// now njs_object_hash_is_empty(value) is false o_O
>> console.time(); a.reduce((x) => x, 0); console.timeEnd();
default: 113.228310ms
undefined
>> console.time(); a.reduce((x) => x, 0); console.timeEnd();
default: 111.459864ms
undefined
>> console.time(); a.reduce((x) => x, 0); console.timeEnd();
default: 112.251771ms
undefined
BTW, typo?
njs_array_interator_args_t -> njs_array_iterator_args_t
@drsm
Thanks for reporting.
now njs_object_hash_is_empty(value) is false o_O
since https://hg.nginx.org/njs/rev/df385232d2af "length" NJS_PROPERTY_HANDLER was copied to private array hash at the moment it was accessed.
Most helpful comment
@drsm
Thanks for reporting.
since https://hg.nginx.org/njs/rev/df385232d2af "length" NJS_PROPERTY_HANDLER was copied to private array hash at the moment it was accessed.