Comment

Comment by kevingadd

jsperf test cases like this don't produce valid results.

The amount of work done in the test case is very small (actually dwarfed by the setup part of the test), making it subject to huge variance due to factors like task switching, GC pauses, etc.

The result of the benchmark is also never used so it is possible for a valid JS runtime to partially or completely optimize it out.

Benchmark actual code doing actual work. Code reduced to this level of meaninglessness does not allow you to draw meaningful conclusions about actual JS performance.

parent kevingadd 13 years ago

Discussion

Live from the official Hacker News API

A modern reader for Hacker News · SvelteKit + Skeleton