|
Boost : |
From: Dave Jenkins (david_at_[hidden])
Date: 2007-06-01 11:39:57
Andy,
You did a nice job speeding up the uuid::create(engine) function to 0.4
seconds for 1 million UUIDs. But now the uuid::create() function is
extremely slow - 131 seconds for 1 million UUIDs (source code below). Can
you change it to use a static mt19937 engine?
Thanks,
Dave Jenkins
#include <boost/uuid.hpp>
#include <boost/progress.hpp>
#include <string>
int main(int, char*[])
{
using namespace boost;
int const N = 1000000;
// mt19937 engine;
timer t1;
for (int i=0; i<N; i++)
uuid::create();
// uuid::create(engine);
std::cout << "elapsed time: " << t1.elapsed() << '\n';
return 0;
}
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk