One second code: Do YOU know how much your computer can do in a second?
Posted by jpluimers on 2021/02/11
[WayBack] One second code: Do YOU know how much your computer can do in a second? is a quiz version of the [WayBack] Numbers Every Programmer Should Know By Year.
[WayBack] About this game revealed it was made by 3 people curious in the speed of their hardware which – not surprisingly – has been relatively stable over the last decade or so.
Source code is at [WayBack] GitHub – kamalmarhubi/one-second: Fun performance game!
I bumped into it via these tweets:
- [WayBack] Yaron Minsky sur Twitter : ”
Just blew my 17yo kid’s mind. Had him benchmark walking an array in linear order vs randomized order, to bypass prefetching.
He thought he knew how a computer works, kind of.
Now he knows he doesn’t. (And I don’t really, either.)” - [WayBack] 🔎Julia Evans🔍 on Twitter : ”
i made computers-are-fast.github.io a while back which makes you guess how long things take!… “
I like games like this (ever played the The Deadlock Empire multi-threading game?), so I played the computers-are-fast.github.io tests, and learned a lot:
[WayBack] Thread by @jpluimers: “@astropuffin @b0rk @yminsky 9/18 here. Not sure that is poor, as I learned a lot from it. This is what I learned after industry for 30+ years: “
- Google being a 3 millisecond ping away made me guess google.com query frequency to be ~100 Hz. Here, curl can dot it at ~15 Hz. Seems most are less lucky.
- Knowing Linux fork being fast, I was amazed how many magnitudes it is faster than process start.
- @b0rk’s SSD is way faster than mine which made my estimation of 10 million bytes/second write speed too slow.
- SSD and interface speeds have improved more than I thought.
- The grep implementation is way faster than I anticipated.
- Parsing of msgpack is only an order magnitude faster than parsing JSON. My guess was at least two orders of magnitude.
- I assumed SQLite did everything in memory, and kept SQL statements prepared, so I was 2 orders of magnitude too high on both the indexed and non-indexed query.
- Boy, md5 is much faster and bcrypt much slower than I thought. Again 2 orders of magnitude wrong. On both sides.
Definitely stuff to show some development and operations teams. Including of course the interactive graph people.eecs.berkeley.edu/~rcs/research/interactive_latency.html … (be amazed at the things that have staid constant speed over time)
The game brings the latency numbers way more in perspective than I thought. For background reading, see Latency Numbers every Programmer and Architect should know.
For more things on perspective, two videos below:
- the famous “Grace Hopper explains the nanosecond”
- Jeff Dean lecturing at Stanford: “Building Software Systems At Google and Lessons Learned”
Via:
- [WayBack] Latency Numbers Every Programmer Should Know | Hacker News (which has a great informational thread).
- [WayBack] Google Pro Tip: Use Back-of-the-envelope-calculations to Choose the Best Design – High Scalability –
–jeroen
Leave a Reply