batmanjs/batman — pull request #1026 by rmosolgo (2014-04-15 22:32:07+00:00)
Title: Calls to Model.find should be pipelined to the same request

Currently, `Model.find` creates a new record then calls `load` on it. `load` is made to pipeline requests, but `find` cant take advantage of this because the newly-instantiated record is in state `clean`, not state `loading`. I'm hoping to take advantage of the work in `load` by tracking instances in calls to `Model.find`

Especially in the case of bindings with belongsTo relations, its easy to quickly fire off 100 requests for the same record. Chrome groups them, but firefox doesn't ... which leads to DOSing yourself :crying_cat_face:

This fix does nice -- the only other change I had to make was to indent a storage call in `polymorphic_has_many_test`. I'm gonna start trying it out in our app, too.

@danott, this is what I was mentioning before...