valkey-io / valkey

A new project to resume development on the formerly open-source Redis project. We're calling it Valkey, since it's a twist on the key-value datastore.

Home Page:https://valkey.io

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Significance of absolute accurate `used_memory`?

lipzhu opened this issue · comments

The problem/use-case that the feature addresses

Currently, when call the zmalloc/zfree related functions, it will call the zmalloc_size and atomic operations to update used_memory, these are all costly operations, is it worth to put such expensive operation in a frequently low API?

Some pull requests are submitted to optimize for such kind of this issue.

#308
#453

Alternatives you've considered

Maybe we can consider to remove the absolute accurate property of used_memory to trade off between the performance?