[Freeciv-Dev] (PR#6925) Measure memory management overhead
[Top] [All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
<URL: http://rt.freeciv.org/Ticket/Display.html?id=6925 >
> [i-freeciv-lists@xxxxxxxxxxxxx - Sat Nov 22 22:50:04 2003]:
>
>
> The issue of memory handling overhead comes up quite often. The last
> time in the safe-genlist thread. It is time to fill the discussion
> with some facts. From the profile of an autogame on a Linux system it
> we know that the overhead is quite small. The question is what
> overhead other systems have. Since not all systems support profiling
> the following patch was made.
>
> The overhead depends on the malloc implmentation (is in the libc) and
> to a lesser extends on the OS. If you have a non-glibc system please
> apply the patch and run the autogame. The most interresting systems
> here are Win32 and commerical unix versions with their native libc
> version.
>
> The absolute numbers are not important. Also the autogame isn't
> important (the attached just works).
>
> You get an output like this:
>
> [0 malloc ] calls= 5784117 time=4.518493s
> [1 realloc ] calls= 104447 time=0.251182s
> [2 strdup ] calls= 4890 time=0.003150s
> [3 free ] calls= 5708727 time=3.779969s
> [4 null ] calls=11602181 time=4.518997s
> [5 total ] calls= 1 time=762.919344s
> (8.552794-4.518997)/762.919344 = 0.528732%
>
> Please mail this and your libc and OS version. I for example have used
> glibc-2.2 and linux-2.4.
Freaky. I didn't get the same number of calls:
[0 malloc ] calls= 5784119 time=3.958480s
[1 realloc ] calls= 104447 time=0.223444s
[2 strdup ] calls= 4891 time=0.001654s
[3 free ] calls= 5708729 time=3.251998s
[4 null ] calls=11602186 time=4.310892s
[5 total ] calls= 1 time=595.190819s
(7.435576-4.310892)/595.190819 = 0.524989%
I ran it like this:
./ser -r mem.rc
start
Using current CVS HEAD. glibc-2.3.2, linux 2.4.22.
|
|