Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Newer
Older
100644 69 lines (44 sloc) 1.809 kB
23c77fc @steveklabnik fuck all 'yall
steveklabnik authored
1 ## Turbolinks test
2
3 Well, by now, you've done all your arguing on Twitter. Is Turbolinks a good
4 idea, or the Worst Thing Ever?
5
6 ### optimizing a bit early
7
8 ![don knuth](http://upload.wikimedia.org/wikipedia/commons/4/4f/KnuthAtOpenContentAlliance.jpg) ![tony hoare](http://upload.wikimedia.org/wikipedia/commons/thumb/2/2c/Sir_Tony_Hoare_IMG_5125.jpg/600px-Sir_Tony_Hoare_IMG_5125.jpg)
9
10 See these guys? One of them said this:
11
12 > "We should forget about small efficiencies, say about 97% of the time: premature optimization is the root of all evil"
13
14 Wisdom.
15
16 But what makes optimization premature? When you don't know if you should do it
17 or not. How do you know?
18
19 ### measure twice, cut once
20
21 ![measure twice](http://barnraisersllc.com/wp-content/uploads/2010/08/Measuring-Tapes1.jpg)
22
23 Measuring. It's good for you. You can do it. If you measure things, you can be
24 sure what's up.
25
26 But like eating your veggies, nobody measures. Ever.
27
28 ### you're a scientist, dammit
29
30 Computer **SCIENCE** is called science for a reason, yo. Be a scientist. Don't
31 just argue about stuff on blogs. Measure things. Then report back.
32
33 ### this test sucks
34
35 This probably isn't even a good test. I don't care. Tell me how it sucks. Let's
36 figure it out. But having actual measurements beats complaining about shit on
37 Twitter any day.
38
39 ## To run it:
40
41 ```
42 $ bundle
93b3371 @ryanb use env variable to set number of times link is clicked
authored
43 $ rake assets:precompile
44 $ TIMES=100 rspec
23c77fc @steveklabnik fuck all 'yall
steveklabnik authored
45 ```
46
47 Done.
48
49 What I get:
50
51 With 1000 pages:
52
53 ```
54 $ rspec
55 user system total real
56 no turbolinks 11.170000 0.980000 12.460000 (138.656728)
57 yes turbolinks 10.800000 0.870000 11.670000 ( 80.436286)
58 ```
59
60 With 100 pages:
61
62 ```
63 $ rspec
64 user system total real
65 no turbolinks 1.640000 0.190000 2.140000 ( 15.652763)
66 yes turbolinks 1.120000 0.090000 1.210000 ( 7.776116)
67 ```
68
Something went wrong with that request. Please try again.