3 ms·
In the case of Clojure, log is log base 32, so it's close enough to O(1) as to make no difference in most circumstances.
by stcredzero 13y ago
In the case of Clojure, log is log base 32, so it's close enough to O(1) as to make no difference in most circumstances.
- barrkel 13y agoMany immutable algorithms replace arrays with trees. Trees are pointer-heavy, and pointers are less cache-friendly than arrays. Memory access is often over 100x the cost of an L1 cache hit. It doesn't take too many of those to make a big difference if you're CPU bound. My comments are general, I'm sure Clojure has access to arrays where necessary for interop at least.
- stcredzero 13y agoAgain, true, but the big problem I'm facing isn't raw performance so much as it's guaranteed latency.
- sitkack 13y agoBut the constant factor is Z, a very large number. A number so large it has a color and name. It pays taxes, has lunch and sees movies on the weekend.
- stcredzero 13y agoNot true in the context of dynamic languages. The constant factor for persistent maps in that context is quite small.