boazsender / backbone.search

Quick search plugin for backbone collections using the Quicksilver string ranking algorithm.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Don't set comparator on search result collection before adds

iros opened this issue · comments

Backbone will resort the collection every time you add a model! This becomes incredibly inefficient. Move the comparator setting once the search collection is built and then perform the sort once.
(Although again, I don't think you should set an attribute on it.)