5 ms·
Pretty cool, but a number of the questions are totally unknowable. For instance the question about web requests to google. Depending on your internet connectio
by gizmo 10y ago
Pretty cool, but a number of the questions are totally unknowable.
For instance the question about web requests to google. Depending on your internet connection you've got more than a order of magnitude difference in the outcome.
In the question about SSD performance the only hint we have is that the computer has "an SSD", but a modern PCIe SSD like in the new Macbook pro is over 10 times faster than the SSDs we got just 5 years ago.
The question about JSON/Msgpack parsing is just about the implementation. Is the python msgpack library a pure python library or is the work of the entire unpackb() call done in C?
The bcrypt question depends entirely on the number of rounds. The default happens to be 12. Had the default been 4 the answer would have been 1000 hashes a second instead of 3. Is the python md5 library written in C? If so, the program is indistinguishable from piping data to md5sum from bash. Otherwise it's going to be at least an order of magnitude slower.
So I liked these exercises, but I liked the C questions best because there you can look at the code and figure out how much work the CPU/Disk is doing. Questions that can be reduced to "what language is this python library written in" aren't as insightful.
- dom0 10y agoYou very well captured the intention of this (or at least what I think is the intention). I mentioned above that in highly abstracted systems it is not at all unusual to spend more time with inefficiencies rather than doing real work: You noticed here that it is also hard to tell in a high abstraction layer which operations might be fast and which may be slow. Often this is even found in seemingly simple places, e.g. traversing a List<> in Java can have vastly different performance characteristics (LinkedList vs. ArrayList).
- dragontamer 10y agoThis is exactly my main complaint about this. Still, it was an intriguing idea, even if a lot of the answers were based on things not described. I did learn a few things... I don't do much parsing so I didn't realize how slow JSON was compared to other packaged formats.
- geogriffin 10y agoit's the required escaping of quotation marks!! if you have non-english users and didn't turn off escaping of non-ascii then you're in for a real surprise :) length-prefixed strings would solve this. also, memory allocation penalties can hit you hard, depending on your environment, since it's hard to predict what you'll need to allocate when encoding / decoding json