Boost Users :
Subject: Re: [Boost-users] [Multi-index] hash_unique memory consumption vs std::map
From: Michael Fawcett (michael.fawcett_at_[hidden])
Date: 2008-11-05 14:58:48
On Wed, Nov 5, 2008 at 2:38 PM, Joaquin M Lopez Munoz <joaquin_at_[hidden]> wrote:
> Oh, sorry, I didn't understand your scenario at first. I thought
> you have one container with millions of elements, when what you
> have is millions of containers with a few elements (22) each. Is
> that right?
Yes exactly, sorry I wasn't clear.
> Absolutely, just add some prime which is roughly 53/2, say 23.
> I'm sorry this is forcing you to change B.MI source code.
> Please report back whether this improves things.
I was trying this as you responded. I tried 23 and things improved
greatly. It now uses less memory than std::map (as you suspected) by
about 1%, or 1.2MB in my small graph test case. This will go up to
about 120MB in my large graph test case, so that's very helpful.
For more gains over std::map -
Graph load times decreased by 3.4%.
Graph search time decreased by 17%.
Graph save times decreased by 14%.
By the way, I've always been impressed by how quickly you respond on
these mailing lists in the past. You continue to impress ;)
Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net