Christopher Smith on 2 Jul 2003 19:45:02 -0000 |
[Date Prev] [Date Next] [Thread Prev] [Thread Next] [Date Index] [Thread Index]
Re: [ALACPP] C++ GC (was smart pointers in C) |
On Wed, 2003-07-02 at 11:51, Arlo Belshee wrote: > > Ah! It seems like you are intending to still use the standard heap > > allocator. That will make it pretty hard for the mark/sweep allocator to > > win. Half the fun mark/sweep is having heap allocs that are almost as fast > > as stack allocs. > > What I'd really prefer is to make the selection of allocator orthogonal to the > selection of memory management strategy. It'd be nice if the boost shared ptr > allowed you to easily specify an allocator as part of the type (you can use it > with an allocator, using a factory method and its custom destructor facility). > Then the final user could choose which one to use. Unfortunately, allocation is tightly coupled with automatic memory management, at least of high-performance implementations. > Besides, they've sped up the default heap a lot over time - custom allocators > don't necessarily beat it any more. See earlier discussion on Alexandrescu's > small object allocator's performance vs MSVC 6.0's default heap. It's true that custom allocators are frequently not a win, but there is a whole ton of overhead in managing a manually-managed heap. The 1000 millisecond times for allocating a raw are clearly much worse than can be achieved with a managed heap (typically they can allocate with just a few instructions). > If however, you know of a really high performance allocator, it might be nice > to provide that as an option one for the gc pointer. I hear Java has a nice one. The CLR's is supposed to be pretty nice too. ;-) --Chris _______________________________________________ alacpp mailing list alacpp@xxxxxxxxxxx http://lists.ellipsis.cx/mailman/listinfo/alacpp