4 ms·
That's very believable. Example: popping from the beginning of a list in Python is O(N). Popping from the end is O(1). Initial poorly written code can have a l
by lqdc13 10y ago
That's very believable.
Example: popping from the beginning of a list in Python is O(N). Popping from the end is O(1).
Initial poorly written code can have a lot of such obvious optimizations.
- sgt101 10y agoIt's a common programming thing - you write your code, it compiles, it runs, it runs properly on your test case, you try it on your full data, it's too slow. You run your profiler and you spot some problems, you solve them, it's still too slow, repeat until fast enough, declare victory.