
"Christian Henning" <chhenning@gmail.com> wrote in news:949801310705291442q6067e19dsb0bd26722561b71f@mail.gmail.com:
I like the way you circumvent the license problem. Rewriting. Cool
Thanks :)
One question. One person reported that the uuid lib was quite slow in comparison to C# for instance. Could you resolve that, too?
I did optimize the random-based create function. It, of course, does depend on the random number generator used. The uuid::create(engine) (using mt19937) is now a little faster then .NET's. For 10,000,000 calls to uuid::create(engine), I get 3.937s, and for .NET's Guid::NewGuid(), I get 4.375s. The name-based uuid::create function has not been optimized. Here are the tests I used: #include "stdafx.h" #using <mscorlib.dll> using namespace System; int _tmain() { const int N = 10000000; DateTime t0 = DateTime::Now; for (int i = 0; i < N; i++) { Guid::NewGuid(); } TimeSpan ts = DateTime::Now - t0; Console::WriteLine(ts.ToString()); return 0; } and: #include <boost\progress.hpp> #include <boost\uuid.hpp> #include <iostream> #include <boost/random.hpp> int main(int argc, char* argv[]) { using namespace boost; const int N = 10000000; mt19937 engine; timer t1; for (int i=0; i<N; ++i) { uuid::create(engine); } std::cout << t1.elapsed() << '\n'; return 0; }
Thanks for your great work, Christian
< snip > Andy.