olivernn / lunr.js

A bit like Solr, but much smaller and not as bright
http://lunrjs.com
MIT License
8.96k stars 548 forks source link

Fix inefficient arguments #129

Closed maxnordlund closed 9 years ago

maxnordlund commented 9 years ago

This changes all Array.prototype.slice.call(arguments) into for loops. This is to avoid performance issues with deoptimization.

olivernn commented 9 years ago

I've added one of the changes to the latest release 0.5.8, specifically the changes to SortedSet#add.

The others I feel are not hot enough parts of the code to warrant the change, but SortedSet#add is heavily used so it was a worthwhile change balancing performance with readability etc.

Thanks!