3 ms·
There's one thing you can do without benchmarking: approximate complexity (O(n)) analysis. You need to be sensible about what N is though: even O(n^3) isn't too
by pjc50 11y ago
There's one thing you can do without benchmarking: approximate complexity (O(n)) analysis. You need to be sensible about what N is though: even O(n^3) isn't too bad if it's an operation on a user-displayed list of half a dozen items.
With a bit of thought this even leads to cleaner code: do you really need to pass a large chunk of data around when you only need a particular precalculated quantity?
But generally benchmarking and applying Amdahl's law is the way to go. First identify which part of the system is slow!
- deleted 11y ago[deleted]
- losvedir 11y agoHave you not used redis? Every command[0] begins its documentation with its time complexity. [0]http://redis.io/commands http://redis.io/commands