Boost logo

Boost :

From: Jarrad Waterloo (jwaterloo_at_[hidden])
Date: 2007-05-31 10:10:20

Sorry, this is a late review question. Has Microsoft GUID algorithm been
published in any way? If it has, could we get an implementation of it?
Typically when working on databases, one would not want to mix generated
guids from different algorithms as that would compromise its uniqueness and
thus increase collisions. So, if I was working on a Microsoft SQL Server, I
would like to and may have to if an existing app with existing data, use the
Microsoft GUID algorithm!

-----Original Message-----
From: boost-bounces_at_[hidden] [mailto:boost-bounces_at_[hidden]]
On Behalf Of Andy
Sent: Wednesday, May 30, 2007 10:01 AM
To: boost_at_[hidden]
Subject: Re: [boost] [guid] - review results?

"Christian Henning" <chhenning_at_[hidden]> wrote in

> 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++) {
    TimeSpan ts = DateTime::Now - t0;

    return 0;


#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) {

    std::cout << t1.elapsed() << '\n';

    return 0;

> Thanks for your great work,
> Christian

< snip >


Unsubscribe & other changes:

Boost list run by bdawes at, gregod at, cpdaniel at, john at