malloc speed
Chris Torek
chris at mimsy.UUCP
Mon Aug 8 08:11:00 AEST 1988
>In article <697 at goofy.megatest.UUCP> djones at megatest.UUCP (Dave Jones) writes:
>>The malloc() on in Sun3 OS, for example, is incredibly slow
>>after a few thousand blocks have been allocated...
In article <1988Aug7.002334.6987 at utzoo.uucp> henry at utzoo.uucp (Henry Spencer)
answers:
>This just says that whoever wrote Sun's malloc was incompetent. There is
>nothing inherently hard about writing a fast malloc, although it's not
>simple, especially for widely-diversified needs.
To be fair to Sun, consider their environment: They are running large
virtual memory systems (`bloated VAX-spawned code' :-) ) on machines
with small virtual memories (backing stores). If you have only 8MB of
swap space, you will want to conserve it. One way to conserve memory
is to trade speed for space, which is what was done in their malloc().
(Of course, shared libraries and memory could help immensely, given that
part of the reason for the bloat in SunOS programs is the enormous size
of the window system. How much difference it really makes in SunOS 4.x
have yet to see for myself.)
--
In-Real-Life: Chris Torek, Univ of MD Comp Sci Dept (+1 301 454 7163)
Domain: chris at mimsy.umd.edu Path: uunet!mimsy!chris
More information about the Comp.lang.c
mailing list