scraperwiki/xypath — pull request #31 by pwaller (2013-08-12 14:09:11+00:00)
Title: Apply filter() lambda to the cell, rather than the bag

This change eliminates 90% of the runtime of the `filter()` call by
removing the need to construct a singleton bag for every XYCell.

This improvement is fairly large since this is where 50% of the time
of our tests was spent, and `filter()` is one of the most common operations
one wants to do.

I've put this in a separate pull request because the change may be controversial
and/or break code in the wild which depends on `filter(lambda bag: [...])` as
opposed to `filter(lambda cell: [...])`. However, I can't think of any reasonable
thing one might want to do which requires bag operations other than `shift()`,
so I've added `shift()` to the `_XYCell` class.

@dragon? @paulfurley?