Friday, April 12, 2013

Deep JS object comparisons

Micro-benchmark comparing doing manual object property traversal and using JSON.stringify and string comparison of the result. One might think that the JSON approach would be spending more time in native code, thus would be faster, despite the string allocation overhead. But the manual property traversal is always faster (JIT FTW).