4 ms·
It's not that. Something not properly covered in CS courses is that very often, performance is dominated by things that are not evaluated as a part of big O ana
by TeMPOraL 7y ago
It's not that. Something not properly covered in CS courses is that very often, performance is dominated by things that are not evaluated as a part of big O analysis. Like, memory allocations, cache friendliness, and other constant factors.
For example, according to the theory, a hash table is much better suited for key lookup and random additions than a vector. In practice, if you're storing a couple hundred elements, a flat array (with objects stored directly) will be faster because of data locality. If your problems are mostly "do a lot of small N ops" and not "do some large N ops", then big O analysis isn't all that useful anymore.
- seanmcdirmid 7y agoThis is covered in computer architecture, at least, and sometimes (but not often) in compilers.
- samfisher83 7y agoThat is taught in your compilers class.