Any point where we try to prevent the browser from reparsing css and js (forcing behavior from the vm instead of letting the vm do it’s job) from a page click tells us something… that the browser should just keep the ASTs and any associated metadata when it sees a 304 and then respects the cache expiry. Why doesn’t it do that? It’s a prevalent case, after all.
A clean-room environment is a bit easier; you can normally assume that every page load starts off the same way. it’s like rebooting your computer between every task… a known clean slate.
Of course, not optimal, but I think that’s why it is the way it is.
That’s unacceptable since it is the wrong assumption to make. The common case is page transitions within the same domain using the same resources. That’s why we have cache expiry periods so we don’t even have to send a request and get a 304 all the freaking time, but nobody uses them because what if you want to change the css slightly? The server has no way of invalidating cache entries with a normal request. (Does it?)
The browser could make better decisions upon seeing the 304 to not reparse if it is reusing the same resource. That’s where you should solve the problem. It would make all websites better instead of only the ones that do some weird crazy hack to get around it.
For those of us too lazy to watch videos or read sources, what does the test do?
My understanding is that turbolinks is fast because it saves the browser from reparsing large css or js files. I’m curious how the test measures that. The readme says you load 1000 pages in 10 seconds, I think, but doesn’t mention what’s doing the loading.
It hits a page, then clicks a link to go to another. 1000 times. Via Selenium. I include versions with a blank rails app, basecamp’s CSS and JS, each indivdually, as well as together, and am currently working on one where it sleeps in the controller too.
ah, so it does use a browser. maybe you could clarify that in the readme. if you can fit two giant heads in the readme, i’m sure there’s room for a sentence about how the measurement is done. :)
But where’s the rant value in that?
Added in https://github.com/steveklabnik/turbolinks_test/commit/4c513285ff1c5ae922e361c62f868b5cba14a7f6 , thank you.
I’m not a ruby user (only saw this article because I was browsing anonymously) but I think this would a much better example of benchmarking if it were a bit more sophisticated in choosing sample size. At the very least, it would be great to show measures of variance.
With the latest pull request, you can pass a TIMES environment variable.
Variance would be good. I’m trying to just get people to look at numbers at all, I’m sure Benchmark provides tools for doing variance.