4 ms·
If you're measuring performance and haven't seen this talk by Emery Berger, I highly recommend it. It's mind blowing, but also terrifying when you realize how
by reitzensteinm 3y ago
If you're measuring performance and haven't seen this talk by Emery Berger, I highly recommend it.
It's mind blowing, but also terrifying when you realize how many mistakes you've been making up until this point.
https://youtu.be/7g1Acy5eGbE https://youtu.be/7g1Acy5eGbE
- screye 3y agoNot everyday you see Emery be the top comment on HN. I was lucky to be in his courses in grad-school. It's the most fun I've had in an American classroom, all while discussing serious systems stuff. A gem of a professor.
- tialaramex 3y agoI've watched another version of this talk (maybe at Strange Loop), but I'm pretty sure I hadn't seen this hangup on measuring weird C++ artefacts against Python before which comes before the interesting stuff and for me was a big disappointment. Comparing the size of C++ int (which will be the 32-bit signed integer because hey why not) against Python's integers (which are just fully arbitrary big integers) is unfair. But it doesn't stop there, next it measures std::list<int> which is a doubly linked list, a container that C++ keeps around partly because it is infested with the sort of programmers who've heard this data structure is sometimes a good choice (it is) and therefore reach for it first -- exactly the sort of bad optimization we're warning against. Python doesn't even have a doubly linked list. Then it compares std::map<int,int> against Python's dict, but std::map is a red-black tree of linked lists, Python's dict is a hashtable, because of course it is. So these aren't anywhere close to comparing like with like either.