Ok, so I took some time and read through the patch more completely. It
didn't seem like much had actually changed so I wanted to figure out
the differences. The performance comes from two places:
1) Not using .is(":visible") (that speeds up height/width).
2) Re-organizing inner/outerWidth so that they could fast-path through
the height/width calculations without having to have the dimension be
re-added.
So, I took those two concept and integrated them.
The perf test suite:
http://dev.jquery.com/~john/ticket/3082/The test suite (passing in all browsers):
http://dev.jquery.com/~john/ticket/3082/test/?eight (height tests)
http://dev.jquery.com/~john/ticket/3082/test/?idth (width tests)
The patch:
http://dev.jquery.com/attachment/ticket/3082/3082.patchLanding:
http://dev.jquery.com/changeset/6195The result is even faster than what Mike originally proposed (as you
can see from the perf test suite). I'm seeing 10-20% over Mike's on
height/width, 20-30% on innerHeight/Width, 100% on outerHeight/Width,
and 10-40% on outerHeight/Width(true).
Thanks a ton, Mike, for this set of tweaks - it's a huge win!
--John