HP-UX 11i March 2002 Release Notes
Programming
Libraries
Chapter 13
219
The smallest ordinary cache that is legal and will activate small block caching (if the SBA
is also configured) is
_M_CACHE_OPTS=1:8:0
It can happen that activating small block caching with this minimum level of ordinary
cache gives all the performance benefit that can be gained from malloc cache, and
increasing the ordinary block cache size further does not improve matters. Or, increasing
cache size further may give some further improvement for a particular application.
The malloc() per-thread cache is a heuristic which may or may not benefit a given
kernel-threaded application that makes intensive use of malloc. Only by trying different
configurations can you determine whether any speed improvement can be obtained from
per-thread cache for a given application, and what the optimal tuning is for that
application.
Impact
Although there will be no impact on performance if cache is not configured (or if
application is not kernel-threaded), significant speed performance improvements are
possible for some kernel applications if cache is configured.
A small additional space cost (in process heap size) is associated with the cache
machinery. While there is no per-block space cost for caching small blocks, there is a
small space cost per ordinary block cached. Therefore, ISVs whose applications are very
memory intensive may want to configure only a minimum-sized or very small ordinary
cache when experimenting with this feature.
The malloc() thread-private cache does not change the function of malloc() for
nonthreaded or CMA-threaded applications. It does maintain binary compatibility.
However, because it is a change in allocation policy, it can cause different sequences of
addresses to be emitted for the same sequence of requests than a previous version of
malloc would have emitted. This level of compatibility is more stringent than ordinary
binary compatibility and has never been guaranteed across releases of malloc.
The libcres.a Library
Provided with the original release of 11i, libcres.a is a small archive library that
contains string, memory and other functions, to provide customers running
performance-critical applications with the benefit of a static link.
Linking statically with libc is not a supported method of linking an application. Any
performance improvement is highly dependent on the application’s use of the included
functions. The functions included in this library are as follows:
abs(), bsearch(), div(), ffs(), insque(), labs(), ldiv(), memchr(),
memcmp(), memcpy(), memmove(), memset(), strcat(), strchr(), strcmp(),
strcpy(), strcspn(), strlen(), strncat(), strncmp(), strcpy(), strrchr(),
strspn(), strstr(), swab()
To make use of this library, existing makefiles must be modified to include it on the link
line. Existing applications must be re-linked to use this library.
The modules of this library are compiled with the HP optimizing compiler using a +O4
flag. As a result, the applications using this library can be linked only by using the HP
optimizing compiler.
The functions in this library cannot be overwritten with a user-defined function of the