Boost logo

Boost :

Subject: Re: [boost] [uuids] On boost::uuids::uuid operator == performance.
From: Peter Dimov (pdimov_at_[hidden])
Date: 2012-04-16 19:31:56


Michael Kochetkov wrote:
> boost::uuids::uuid id1((boost::uuids::random_generator()())),
> id2((boost::uuids::random_generator()()));

I prefer to leave id2 identical to id1 at the start, because otherwise the
two are never equal.

Core i7-920, VC++ 2005 32 bit:

operator==
    48830: 1087
Eq16
    48830: 311
memcmp
    -53027366: 560
my_memcmp:
    48830: 281

64 bit:

operator==
    48830: 674
Eq16
    48830: 314
memcmp
    -2978538: 773
my_memcmp
    48830: 264

Alignment is not the problem. id1 and id2 are aligned at a DWORD boundary
(actually, on a 16 byte boundary under 64 bit).


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk