3 ms·
Definitely interesting. Makes me wonder about the performance of sum types for error handling (e.g., Result in Rust).
by azhenley 6y ago
Definitely interesting. Makes me wonder about the performance of sum types for error handling (e.g., Result in Rust).
- vips7L 6y agoI would guess it would be the same as error codes, as you have to go through the branch everytime to check if it's Err or Ok.
- LorenPechtel 6y agoAt lot of what we learned about performance in the old days is no longer true. I'd say every time I've fired up the profiler to try to speed something up I've gotten a surprise and rarely is it because of inefficient code on my part. (And the only one of those I recall is where I used n^2 routines knowing n was small--only the use had evolved, when I wrote it n was generally around 20 and almost never over 50. When I got asked to look into it there was a case where n was around 2000.)
- Macha 6y agoAnother example of dated performance ideas, linked lists aren't even better for many of their theoretically better use cases: https://www.youtube.com/watch?v=YQs6IC-vgmo https://www.youtube.com/watch?v=YQs6IC-vgmo Slides and missing graph on slide 45 available at: https://sec.ch9.ms/ecn/events/GoingNative12/GN12Cpp11Style.pdf https://sec.ch9.ms/ecn/events/GoingNative12/GN12Cpp11Style.p...
- p0nce 6y agoThey are error codes.