texmacs-dev
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Texmacs-dev] How to mark/copy objects in C++


From: Joris van der Hoeven
Subject: Re: [Texmacs-dev] How to mark/copy objects in C++
Date: Wed, 26 May 2004 10:01:57 +0200 (CEST)

On Tue, 25 May 2004, David Allouche wrote:
> On Tue, May 25, 2004 at 10:18:28AM +0200, Joris van der Hoeven wrote:
> > > I've seen some TeXmacs fragments that say "new T(...)" -- I just wanted
> > > to say that allocation of large chuncks are frequently cheeper than
> > > allocation of lots of small chunks.  Someone would probably have to
> > > audit that for TeXmacs (the primary reason being that in
> > > multi-threaded environment -- if you're windowing, then you get such
> > > beasts -- mutext locks/unlocks are expensive operations).
> >
> > We have a global new operator which should be very efficient for
> > small objects (it uses a linked list for each size <= 256 bytes).
>
> That would be all very well for 80's computers with non-hierarchic
> memory. Even if that increases the computational cost of the allocation,
> it would probably often be cheaper to allocate memory in big chunks,
> because that yields better locality.
>
> That's what I referred to when I suggested "pooled allocation of related
> objects".

I do not see any guarantee that your suggestion is better and
how you would concretely do "pooled allocation of related objects".
You did not even test how well the current allocator preserves locality.
You just assume that it is bad, but you have no emperical evidence.
For this, you could start with measuring the mean distance between
successive objects in the free object list.





reply via email to

[Prev in Thread] Current Thread [Next in Thread]