
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. Ok.
Core i7-920, VC++ 2005 32 bit: I have 6 years old Xeon 5130 and for your original code (with zeros):
operator== 48830: 1087 735
Eq16 48830: 311 406
memcmp -53027366: 560 625
my_memcmp: 48830: 281 485
I can see VC 2010 is probably better in optimization. Anyway the real problems are that 1. boost's implementation of uuid is at least weird in terms there are much better approaches that cost nothing in implementation but are ignored. 2. the investigation of opinions of boost people (I have made another inquiry in "[boost] [function] The cost of boost::function" thread) shows that boost still is not ready for production usage. It requires too high qualification of the real life programmers to be able to slalom in dark corners of boost and C++ itself so it puts the success of a project at high risk. And I have some real life examples (you do not think I study the cases with the debugger on purpose, do you? :) ) 3. The words on the top of the boost.org page ""...one of the most highly regarded and expertly designed C++ library projects in the world." - Herb Sutter and Andrei Alexandrescu, C++ Coding Standards" really need some grounds. I thank you all for your opinions and help. -- Michael Kochetkov