Hacker News new | ask | show | jobs
by Teckla 751 days ago
At $WORK we use Mozilla Rhino for some JavaScript processing.

We tested the normal loop vs. the clever loop. Performance-wise, the normal loop blew the doors off the clever loop.

1 comments

Rhino is a very uncommon engine though. It has its niche, but if you're developing for simpler engines like that, then you typically know that in advance and know what considerations you're going to need to make for that.

When it comes to performance, lessons that apply to Rhino are unlikely to apply to more mainstream engines.

EDIT: That's not to say that everyone should use map and forEach all the time, just that your benchmarks are unlikely to be relevant to most JS devs outside of your specific use-case.