3 ms·
Am I seeing this right? Someone is creating 10000 arrays of increasing size and then wonders why it's slow? Why does this even need benchmarks? It should be obv
by imtringued 8y ago
Am I seeing this right? Someone is creating 10000 arrays of increasing size and then wonders why it's slow? Why does this even need benchmarks? It should be obvious that copying 0.5 billion elements is far slower than only copying 10000.
- braythwayt 8y agoYou are reading it right. I don’t know if it’s obvious, but it is the kind of thing that gets figured out when you find a hotspot in your code and do a little testing.
- xtracto 8y agoThat's the funny thing: Those type of articles is what you get when someone without knowledge of CS theory like Big-O notation gets into an issue of a linear vs higher complexity algorithm. They have to do lots of simulations to grok the depth of the performance difference.
- barrkel 8y agoAnd some people object to testing knowledge of the basics of algorithm complexity analysis with big-O in programming interviews because they "never need that theory". IMO complexity analysis is possibly the single most important bit of theory to understand if you work on apps where there is any n which grows to a large number. More important than being able to reverse a linked list or whatever.