Nah, I know J It was taking ages to populate test data when I was generating it really random. Actually It doesn’t really matter since it may happen in production – you will have 5-15 strings across 1M of objects.

 

 

From: Boost-users [mailto:boost-users-bounces@lists.boost.org] On Behalf Of Dominique Devienne
Sent: Tuesday, November 18, 2014 4:52 PM
To: boost-users
Subject: Re: [Boost-users] More than strange performance test results of Boost.MultiIndex

 

On Tue, Nov 18, 2014 at 8:31 AM, Ernest Zaslavsky <ernest.zaslavsky@sizmek.com> wrote:

[...]. Then when running performance tests I've noticed that once I use composite_key which includes string the performance drops in orders of magnitude, to be precise, 5 orders.

 

Do you have a requirement to return the wstring by value? Why not by const&? Goes back to Lars' COW string remark.

 

Also, your "random" string is not random at all, but constant in fact. Isn't that a pathological case?

 

Unless your indexed members change often, you could also cache the hash. Especially if your string can be long. --DD