Re: memory allocations.

Please don't forget other options: often it is better to arrange not to have
to do an allocation at all, than to amazingly optimize the allocator.

This discussion is reminding me of days when we identified memory allocation
as one of the hotspots inside the X server; by some care, we arranged
to allocate related objects simultaneously in a single malloc and reduced the number of calls to malloc by a substantial factor (2-3x),
while saving the memory overhead
as well, also saving substantial overhead and improving memory footprint
and cache behavior, and avoiding fragmentation.

Similar work was done elsewhere in some of the toolkits (e.g. Xt, Xaw).
                             - Jim

Jim Gettys
Cambridge Research Laboratory
Compaq Computer Corporation
jg pa dec com

gnome-hackers mailing list
gnome-hackers gnome org

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