meteor/meteor — pull request #473 by Ed-von-Schleck (2012-11-11 12:35:40+00:00)
Title: Added a fast path to compilation of selectors if only the _id of a document is queried.

In my application, quite some time is spent in the _compileSelector function.
I assume the 'eval' to be the main culprit (it's hard to profile exactly, though).
A good deal of all queries, however, are pretty simple, so I added a fast path
for the simplest case, which in my case is almost half of all the queries my
application issues. This change speeds up my app significantly.

I guess to solve this non-hackishly, a) indexes have to be implemented and b)
compiled selectors should be cached, but I have to admit that'd be way over
my head.