dragonfly icon indicating copy to clipboard operation
dragonfly copied to clipboard

fix(zset): Better memory consumption calculation

Open chakaz opened this issue 10 months ago • 2 comments

Fixes #2808

chakaz avatar Apr 14 '24 11:04 chakaz

What was the bug?

romange avatar Apr 14 '24 11:04 romange

What was the bug?

To quote from NodeCount():

  size_t NodeCount() const {
    // number of nodes in the tree (usually, order of magnitude smaller than Size()).
    return num_nodes_;
  }

So we were wrong by "an order of magnitude". Unless I got the implementation wrong, but I think I got it right (we allocate per node, not per item)

chakaz avatar Apr 14 '24 16:04 chakaz

@romange ok to merge?

chakaz avatar Apr 15 '24 08:04 chakaz

Yes!

romange avatar Apr 15 '24 08:04 romange