Boost logo

Boost Users :

From: JOAQUIN LOPEZ MU?Z (joaquin_at_[hidden])
Date: 2008-01-30 17:04:21


----- Mensaje original -----
De: Martin Fisher <mnfisher_at_[hidden]>
Fecha: Miércoles, Enero 30, 2008 8:42 pm
Asunto: [Boost-users] Flyweight
Para: boost-users_at_[hidden]

> /*
>
> boost::flyweights::flyweight<string>::initializer init;
> vector<boost::flyweights::flyweight<string> > vec;
> */
>
> Thanks Joaquín. That fixes all. I'd noticed a bit in the doc
> about > initialisation - just my attempt to write a minimal test
> case got the better of me.

It's not your fault at all, the problem is subtle and I
definitely need to document it thoroughly.

> Release is still slower than debug under MS - 60 cf 56s with my
> computer cranked up to full tilt.. Put that down to some
> dubious MS code generation.For comparison the example program
> took 927s for hashed factory when compiled as debug and 1365s
> when compiled as release (ok I didn't repeat the tests!)
> I'll have to get a smaller test file :-)

I don't really know why you're observing such erratic behavior.
I've done the tests myself here with what I believe is the
same text file as yours (http://www2.cddc.vt.edu/gutenberg/
etext92/bible12.txt ) and my results are:

debug string : 5.09 s
release string : 1.33 s
debug flyweight : 18.59 s
release flyweight : 1.97 s

Environment:

Intel Core2 CPU T550 @ 1.66GHz 1.00 GB RAM
Windows XP Media Center Edition 2002 SP2
MSVC++ 2005 Express Edition

If you have any clue why your results differ so much please
share it with me.

Joaquín M López Muñoz
Telefónica, Investigación y Desarrollo


Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net