Boost logo

Boost :

From: Janek Kozicki (janek_listy_at_[hidden])
Date: 2006-10-07 18:11:06


Joaquín M_ López Mu_oz said: (by the date of Fri, 06 Oct 2006 07:48:22 +0200)

> Janek Kozicki ha escrito:
>
> What is your intended usage scenario? It might help me add more diversity
> to the examples section of the lib.

1. I want to try to use it together with boost::serialization when
converting between archive formats. Think about xml format - it has to
remember variable name (as a string) for each variable. But with large
collections, those strings are higly duplicated. Like - a container with
1000 similar objects that have just 8 variables. And of course those
variables have long names, because the names should be descriptive :)

2. a Typo in libs/flyweight/doc/tutorial/holders.html:

"For instance, flyweight&ltT> is equivalent to"
                        ^^^

3. am I right to think that:

flyweight<std::string,hashed_factory<>,global_holder<unsigned char> >

will allow me to have 255 different strings, while

flyweight<std::string,hashed_factory<>,global_holder<unsigned short> >

will allow me to have 65535 ?

4. have you ever thought about sample usage of flywieght to create a new
boost library: boost::flyweight_shared_ptr<T> ?

The problem it tries to solve is that on amd64 each pointer consumes 64
bits (8 bytes!), when people make a switch from 32bits to 64bits, this
hurts badly. In my calculations memory usage grew from 700MB to 1.3GB,
and that actually makes a difference. (it's not possible to run
calculations if some of the data must swap to disc...)

hmm... maybe this will actually work:

boost::flyweight<boost::shared_ptr<T> >

will it?

-- 
Janek Kozicki                                                         |

Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk