I made some real tests, the with() didn't seem to matter much.
I tried replacing jQuery.css for jQuery.curCSS because that was a useless call. The time got lower and saved many calls.
Then cached document.defaultView && document.defaultView.getComputedStyle in a var, and that reduced the time.
I tried all this many many times back and forth to discard CPU interferences.
The element that I called offset on, had 7 parents, and then the body. The latter was its third offsetParent.
Regular
Profile (21359.375ms, 186011 calls)
offset(500 times) - attempt 1: 5359ms test.js (line 17)
offset(500 times) - attempt 2: 5406ms test.js (line 17)
offset(500 times) - attempt 3: 5359ms test.js (line 17)
offset(500 times) - attempt 4: 5297ms
curCSS 4 css
Profile (20296.875ms, 148011 calls)
offset(500 times) - attempt 1: 5093ms test.js (line 17)
offset(500 times) - attempt 2: 5000ms test.js (line 17)
offset(500 times) - attempt 3: 5109ms test.js (line 17)
offset(500 times) - attempt 4: 5109ms
curCSS 4 css, defaultView cached
Profile (16203.125ms, 148011 calls)
offset(500 times) - attempt 1: 3984ms test.js (line 17)
offset(500 times) - attempt 2: 3969ms test.js (line 17)
offset(500 times) - attempt 3: 4078ms test.js (line 17)
offset(500 times) - attempt 4: 4203ms
I made some real tests, the with() didn't seem to matter much.
I tried replacing jQuery.css for jQuery.curCSS because that was a useless call. The time got lower and saved many calls.
Then cached document.defaultView && document.defaultView.getComputedStyle in a var, and that reduced the time.
I tried all this many many times back and forth to discard CPU interferences.
The element that I called offset on, had 7 parents, and then the body. The latter was its third offsetParent.