Earlier quoted context omitted.
They've been in the language for about a decade now, and before that we had the tr1 hash_map classes that were available in most environments.
C++: the language that's been around for 40 years and is completely new!
Accidentally quadratic: When Python is faster than C++
211–215 of 215 posts
Re: Accidentally quadratic: When Python is faster than C++
#212Earlier quoted context omitted.
1. People often use set instead of unordered_set (and same for map) despite not needing order. This slows things down. 2. The C++ standard library's maps and sets are known to be rather slow. See, for example: https://stackoverflow.com/q/42588264/1593077 when you have string values, it's even worse, as you describe. But it's not clear that an overly-clever implementation, which caches numeric ranks of strings etc., i…
Why is the default set implementation ordered in the first place? The formal data structure is unordered, which probably informs people's assumptions about its performance characteristics. Should it not be "set" and "ordered_set"?
If/when `std2::` happens, this is one of the things I assume would change.
Re: Accidentally quadratic: When Python is faster than C++
#213Earlier quoted context omitted.
You can literally emit runtime assembly in C in any C toolchain, what are you on about?
How do you dynamically generate machine code without linking something like LLVM?
Re: Accidentally quadratic: When Python is faster than C++
#214Earlier quoted context omitted.
Goto considered harmful is from 1968, so yes.
"goto considered harmful" was at least not wrong. It didn't say who considered it harmful, but at least it was still presented as an opinion. This title states "Python is Faster Than C++", which neither implies that this is just an opinion, nor that it isn't an absolute statement. You have to figure out yourself that it's probably hyperbolic and just referring to special cases.
Re: Accidentally quadratic: When Python is faster than C++
#215Earlier quoted context omitted.
More like "well tuned JS will be nearly as fast as poorly tuned C code"...
True. But if I’m given the choice, I’d usually rather well written javascript than badly written C. And there’s a lot more decent JS programmers out there than decent C programmers.