jquery/sizzle — pull request #171 by gibson042 (2012-10-29 21:19:31+00:00)
Title: Speedup nth-child by caching last node/element indexes

Sizes - compared to jQuery master @ [bea5ecbba72f22e8924186d9b81839122ec86aef](https://github.com/jquery/jquery/commit/bea5ecbba72f22e8924186d9b81839122ec86aef)
```
268474 (+535) dist/jquery.js
93717 (+87) dist/jquery.min.js
33526 (+64) dist/jquery.min.js.gz
```

[Alternate approach](https://github.com/gibson042/sizzle/commit/3d308ce4aa0aece8da6fd072bc8cc13c48721f1c) (visiting elements in reverse order to restore the pre- 41a7c2ce9be6c66e0c9b8b15e0a29c8e3ca6fb31 caching strategy) is similar in size and (on modern browsers) performance impact, but I'm not happy with the [extra array manipulations](https://github.com/gibson042/sizzle/commit/3d308ce4aa0aece8da6fd072bc8cc13c48721f1c#L0R1432). [Benchmarking](https://gist.github.com/3976370) reveals a less impressive `:nth-child` speedup (7x instead of 9x), but I still consider this multi-cache approach superior—and more useful for supporting [`:nth-of-type` and friends](https://github.com/jquery/sizzle/issues/44).