Hacker News new | ask | show | jobs
by eric_bullington 3923 days ago
> "Redis is very fast as long as you use O(1) and O(log_N) commands"

Well, like you say, to me that particular practice would be pretty obvious. More helpful would be a page that shows the time and space complexity of the various commands, akin to the following page for Python:

https://wiki.python.org/moin/TimeComplexity

Edit: Yeah, like the Redis documentation, lol. I think it says a lot for Redis that I almost never need to visit the docs, other than the single page that lists all the commands (back when it was red was the last time I actually needed to look at it). Once you know the commands, quickly reading the changelogs provides me with all I need. Anyway, all that to say I had no idea Redis already provided this complexity information, don't remember them having this back when I first used learned Redis (although maybe they did). Good to know.

2 comments

You mean, akin to the redis documentation?

http://redis.io/commands/sort

"Time complexity: O(N+M*log(M)) where N is the number of elements in the list or set to sort, and M the number of returned elements. When the elements are not sorted, complexity is currently O(N) as there is a copy step that will be avoided in next releases."

this is actually in the command documentation: i.e. http://redis.io/commands/exists

> Time complexity: O(1)