craftyjs/Crafty — pull request #503 by starwed (2013-07-04 23:22:52+00:00)
Title: Changes to how _attr passes change information

The changes are that it:
* Uses the actual object position instead of the MBR. If you want to know how an object has moved, you want to compare its *actual* position, not its MBR.
* Create a rectPool to improve performance by recycling rectangle objects. Previously, a new object was created every time you set an object's position, which hurts performance.

I did a fair amount of benchmarking the rectPool optimization to make sure that it (a) didn't hurt average performance, and (b) really did reduce stutter. I found the best metric was to look at the number of "EnterFrame" events per call to `step()`. With a lot of objects moving around, it reduced this number across the board.

(This PR also has a commit to remove an accidental global in DeubgLayer.js.)