[boost] Re: shifted_ptr<> w/ lock mechanism

2003-01-28 Thread Philippe A. Bouchard
"Philippe A. Bouchard" <[EMAIL PROTECTED]> wrote in message b16m42$7pv$[EMAIL PROTECTED]">news:b16m42$7pv$[EMAIL PROTECTED]... > Lock mechanism was added to shifted_ptr<>: > http://groups.yahoo.com/group/boost/files/shifted_ptr.zip > > Benchmarks are also updated. Still shifted_ptr<> is using les

[boost] Re: shifted_ptr<> w/ lock mechanism

2003-01-29 Thread Philippe A. Bouchard
"David Abrahams" <[EMAIL PROTECTED]> wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... > "Philippe A. Bouchard" <[EMAIL PROTECTED]> writes: > > > Lock mechanism was added to shifted_ptr<>: > > http://groups.yahoo.com/group/boost/files/shifted_ptr.zip > > > > Benchmarks are also updated

[boost] Re: shifted_ptr<> w/ lock mechanism

2003-01-29 Thread Philippe A. Bouchard
"Peter Dimov" <[EMAIL PROTECTED]> wrote in message 000901c2c7dc$e76195e0$1d00a8c0@pdimov2">news:000901c2c7dc$e76195e0$1d00a8c0@pdimov2... > From: "Peter Dimov" <[EMAIL PROTECTED]> > > > > One easy way to estimate the impact of an optimized allocator is to > #define > > BOOST_SP_USE_STD_ALLOCATOR,

[boost] Re: shifted_ptr<> w/ lock mechanism

2003-01-29 Thread David B. Held
"Philippe A. Bouchard" <[EMAIL PROTECTED]> wrote in message b19hhg$i2m$[EMAIL PROTECTED]">news:b19hhg$i2m$[EMAIL PROTECTED]... > [...] > list shifted_ptr took0.0002951000 seconds to construct. > list shifted_ptr took7.1966276647 seconds to reconstruct 2000 > times. > list shifted_pt

[boost] Re: shifted_ptr<> w/ lock mechanism

2003-01-29 Thread Pavel Vozenilek
"David Abrahams" <[EMAIL PROTECTED]> wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... > "Peter Dimov" <[EMAIL PROTECTED]> writes: > > > From: "David Abrahams" <[EMAIL PROTECTED]> > >> "Philippe A. Bouchard" <[EMAIL PROTECTED]> writes: > >> > >> > Lock mechanism was added to shifted_pt

[boost] Re: shifted_ptr<> w/ lock mechanism

2003-01-29 Thread Andrei Alexandrescu
"David Abrahams" <[EMAIL PROTECTED]> wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... > "Philippe A. Bouchard" <[EMAIL PROTECTED]> writes: > > I believe there is not that much left to do besides optimizations. > > Have you tried a comparison against a shared_ptr using an optimized > co

[boost] Re: shifted_ptr<> w/ lock mechanism

2003-01-29 Thread Philippe A. Bouchard
"Andrei Alexandrescu" <[EMAIL PROTECTED]> wrote in message b1a0uv$lju$[EMAIL PROTECTED]">news:b1a0uv$lju$[EMAIL PROTECTED]... [...] > My understanding is that shifted_ptr mandates allocating *your* objects > inside *its* "doped memory" area by using placement new. (Phillippe, please > correct me

[boost] Re: shifted_ptr<> w/ lock mechanism

2003-01-29 Thread Philippe A. Bouchard
"David B. Held" <[EMAIL PROTECTED]> wrote in message b19io8$o05$[EMAIL PROTECTED]">news:b19io8$o05$[EMAIL PROTECTED]... [...] > Looks like your lead is getting eroded by the day. ;) And that's just > with a quick hack. You better be worried about a serious small > object allocator. Not only t

[boost] Re: shifted_ptr<> w/ lock mechanism

2003-01-30 Thread Philippe A. Bouchard
"Philippe A. Bouchard" <[EMAIL PROTECTED]> wrote in message b1a99m$fil$[EMAIL PROTECTED]">news:b1a99m$fil$[EMAIL PROTECTED]... [...] > shifted_ptr only works with "shifted objects" allocated with placement > operator new (size_t, shifted_type const &). In theory it would be possible > to displa

Re: [boost] Re: shifted_ptr<> w/ lock mechanism

2003-01-29 Thread David Abrahams
"Philippe A. Bouchard" <[EMAIL PROTECTED]> writes: >> Have you tried a comparison against a shared_ptr using an optimized >> count allocator? Nobody has invested as much effort in optimizing >> shared_ptr as you are pouring into shifted_ptr, but an experiment I >> did years ago made a huge differ

Re: [boost] Re: shifted_ptr<> w/ lock mechanism

2003-01-29 Thread David Abrahams
"Philippe A. Bouchard" <[EMAIL PROTECTED]> writes: > "Peter Dimov" <[EMAIL PROTECTED]> wrote in message > 000901c2c7dc$e76195e0$1d00a8c0@pdimov2">news:000901c2c7dc$e76195e0$1d00a8c0@pdimov2... >> From: "Peter Dimov" <[EMAIL PROTECTED]> >> > >> > One easy way to estimate the impact of an optimized

Re: [boost] Re: shifted_ptr<> w/ lock mechanism

2003-01-30 Thread Peter Dimov
From: "David B. Held" <[EMAIL PROTECTED]> > "Philippe A. Bouchard" <[EMAIL PROTECTED]> wrote in message > b19hhg$i2m$[EMAIL PROTECTED]">news:b19hhg$i2m$[EMAIL PROTECTED]... > > [...] > > list shifted_ptr took 7.1966276647 seconds to reconstruct 2000 times. > > [...] > > list shared_ptr took 14.015

Re: [boost] Re: shifted_ptr<> w/ lock mechanism

2003-01-30 Thread Peter Dimov
From: "David Abrahams" <[EMAIL PROTECTED]> > > Would you indulge me and try the benchmark again with the enclosed > shared_count patch applied and #undef BOOST_SP_USE_STD_ALLOCATOR? I > don't really know what's going on under the covers in the SGI > allocator; this is basically just the same hack

Re: [boost] Re: shifted_ptr<> w/ lock mechanism

2003-01-30 Thread David Abrahams
"Peter Dimov" <[EMAIL PROTECTED]> writes: > From: "David Abrahams" <[EMAIL PROTECTED]> >> >> Would you indulge me and try the benchmark again with the enclosed >> shared_count patch applied and #undef BOOST_SP_USE_STD_ALLOCATOR? I >> don't really know what's going on under the covers in the SGI >

Re: [boost] Re: shifted_ptr<> w/ lock mechanism

2003-01-30 Thread Greg Colvin
At 06:23 AM 1/30/2003, Peter Dimov wrote: >From: "David B. Held" <[EMAIL PROTECTED]> >> "Philippe A. Bouchard" <[EMAIL PROTECTED]> wrote in message >> b19hhg$i2m$[EMAIL PROTECTED]">news:b19hhg$i2m$[EMAIL PROTECTED]... >> > [...] >> > list shifted_ptr took 7.1966276647 seconds to reconstruct 2000 >

Re: [boost] Re: shifted_ptr<> w/ lock mechanism

2003-01-30 Thread David Abrahams
Greg Colvin <[EMAIL PROTECTED]> writes: > I read a paper yesterday from the latest OOPSLA proceedings > that argued that a class-specific new is almost never a win > compared to a high-quality general purpose allocator like > LEA. In real code, I'm sure that's true. However, for the kind of mea

Re: [boost] Re: shifted_ptr<> w/ lock mechanism

2003-01-30 Thread Peter Dimov
From: "David Abrahams" <[EMAIL PROTECTED]> > "Peter Dimov" <[EMAIL PROTECTED]> writes: > > > I've taken the liberty to convert the patch into detail/quick_allocator.hpp. > > #define BOOST_SP_USE_QUICK_ALLOCATOR to make shared_ptr use it. > > shared_ptr_alloc_test.cpp has been updated, too. You can

Re: [boost] Re: shifted_ptr<> w/ lock mechanism

2003-01-30 Thread Peter Dimov
From: "Greg Colvin" <[EMAIL PROTECTED]> > At 06:23 AM 1/30/2003, Peter Dimov wrote: > > > >To be fair, a factor of two improvement cannot just be shrugged off. But one > >point to keep in mind is that > > > >shared_ptr px(new X); > > > >performs two allocations. We can optimize the count allocation

Re: [boost] Re: shifted_ptr<> w/ lock mechanism

2003-01-30 Thread Greg Colvin
At 08:16 AM 1/30/2003, David Abrahams wrote: >"Peter Dimov" <[EMAIL PROTECTED]> writes: > >> From: "David Abrahams" <[EMAIL PROTECTED]> >>> >>> Would you indulge me and try the benchmark again with the enclosed >>> shared_count patch applied and #undef BOOST_SP_USE_STD_ALLOCATOR? I >>> don't reall

Re: [boost] Re: shifted_ptr<> w/ lock mechanism

2003-01-30 Thread David Abrahams
"Peter Dimov" <[EMAIL PROTECTED]> writes: >> I'm not all set up to run those tests and measure the times, which is >> why I was hoping Philippe would check it out. > > There is a test in libs/smart_ptr/test called > shared_ptr_alloc_test.cpp that you can use. OK. >> > quick_allocator doesn't c

Re: [boost] Re: shifted_ptr<> w/ lock mechanism

2003-01-30 Thread Greg Colvin
At 09:12 AM 1/30/2003, Peter Dimov wrote: >From: "Greg Colvin" <[EMAIL PROTECTED]> >> At 06:23 AM 1/30/2003, Peter Dimov wrote: >> > >> >To be fair, a factor of two improvement cannot just be shrugged off. But >one >> >point to keep in mind is that >> > >> >shared_ptr px(new X); >> > >> >performs t

Re: [boost] Re: shifted_ptr<> w/ lock mechanism

2003-01-30 Thread David Abrahams
"Peter Dimov" <[EMAIL PROTECTED]> writes: > From: "David Abrahams" <[EMAIL PROTECTED]> >> "Peter Dimov" <[EMAIL PROTECTED]> writes: >> >> > I've taken the liberty to convert the patch into > detail/quick_allocator.hpp. >> > #define BOOST_SP_USE_QUICK_ALLOCATOR to make shared_ptr use it. >> > share

Re: [boost] Re: shifted_ptr<> w/ lock mechanism

2003-01-30 Thread Peter Dimov
From: "David Abrahams" <[EMAIL PROTECTED]> > "Peter Dimov" <[EMAIL PROTECTED]> writes: > > > There is a test in libs/smart_ptr/test called shared_ptr_alloc_test.cpp that > > you can use. > > Your test doesn't seem to terminate for me in a reasonable amount of > time (minutes) in any configuration.

Re: [boost] Re: shifted_ptr<> w/ lock mechanism

2003-01-30 Thread David Abrahams
David Abrahams <[EMAIL PROTECTED]> writes: > "Peter Dimov" <[EMAIL PROTECTED]> writes: > >> From: "David Abrahams" <[EMAIL PROTECTED]> >>> "Peter Dimov" <[EMAIL PROTECTED]> writes: >>> >>> > I've taken the liberty to convert the patch into >> detail/quick_allocator.hpp. >>> > #define BOOST_SP_USE_

Re: [boost] Re: shifted_ptr<> w/ lock mechanism

2003-01-30 Thread David Abrahams
"Peter Dimov" <[EMAIL PROTECTED]> writes: > From: "David Abrahams" <[EMAIL PROTECTED]> >> "Peter Dimov" <[EMAIL PROTECTED]> writes: >> >> > There is a test in libs/smart_ptr/test called shared_ptr_alloc_test.cpp > that >> > you can use. >> >> Your test doesn't seem to terminate for me in a reasona

Re: [boost] Re: shifted_ptr<> w/ lock mechanism

2003-01-30 Thread Peter Dimov
From: "David Abrahams" <[EMAIL PROTECTED]> > "Peter Dimov" <[EMAIL PROTECTED]> writes: > > > From: "David Abrahams" <[EMAIL PROTECTED]> > >> "Peter Dimov" <[EMAIL PROTECTED]> writes: > >> > >> > There is a test in libs/smart_ptr/test called shared_ptr_alloc_test.cpp > > that > >> > you can use. > >

Re: [boost] Re: shifted_ptr<> w/ lock mechanism

2003-01-30 Thread David Abrahams
"Peter Dimov" <[EMAIL PROTECTED]> writes: > > You might need to use a lower n. Here's what I get (randomly choosing > g++/mingw): > > GNU C++ version 2.95.3-6 (mingw special) > Win32 > SGI standard library > BOOST_HAS_THREADS: (not defined) > BOOST_SP_USE_STD_ALLOCATOR: (not defined) > BOOST_SP_US

Re: [boost] Re: shifted_ptr<> w/ lock mechanism

2003-01-30 Thread David Abrahams
"Peter Dimov" <[EMAIL PROTECTED]> writes: > From: "David Abrahams" <[EMAIL PROTECTED]> >> "Peter Dimov" <[EMAIL PROTECTED]> writes: >> >> > There is a test in libs/smart_ptr/test called shared_ptr_alloc_test.cpp > that >> > you can use. >> >> Your test doesn't seem to terminate for me in a reasona

Re: [boost] Re: shifted_ptr<> w/ lock mechanism

2003-01-30 Thread David Abrahams
David Abrahams <[EMAIL PROTECTED]> writes: > "Peter Dimov" <[EMAIL PROTECTED]> writes: > >> >> You might need to use a lower n. Here's what I get (randomly choosing >> g++/mingw): >> >> GNU C++ version 2.95.3-6 (mingw special) >> Win32 > > Wow, that's a much bigger improvement than I saw! I wonde

Re: [boost] Re: shifted_ptr<> w/ lock mechanism

2003-01-30 Thread Peter Dimov
From: "David Abrahams" <[EMAIL PROTECTED]> > > > > Your test doesn't seem to terminate for me in a reasonable amount of > > time (minutes) in any configuration. > > That was Cygwin GCC-3.2. You made me download it. GNU C++ version 3.2 20020927 (prerelease) Cygwin GNU libstdc++ version 20020927 BO

Re: [boost] Re: shifted_ptr<> w/ lock mechanism

2003-01-30 Thread Larry Evans
Philippe A. Bouchard wrote: [snip] I guess it would also be possible to allocate a "shifted object" into some specific memory page, so operator delete will be able to quickly detect weither the object is shifted or not. This way it would be possible to overload the main operator new. I think