[lkml]   [2001]   [Oct]   [1]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
Messages in this thread
SubjectVM: 2.4.10 vs. 2.4.10-ac2 and qsort()

I don't know if this "benchmark" is meaningful or not, but anyhow..

As workload I used qsort() on an array of 90000000 32 bit ints.
(trivial code to the end of my email).

The VSIZE of the resulting process is about 343Mb.
Tested machine has 256Mb of RAM + 200Mb of swap.
Same srand() in all tests.

Below are linux-2.4.10 results

run 1:
real 4m54.728s
user 2m47.910s
sys 0m2.520s

run 2:
real 4m55.109s
user 2m46.050s
sys 0m2.530s

kswapd CPU time: 3 seconds
qs RSS always on 238-240M, very stable never below 235M.

.. and 2.4.10-ac2 results

run 1:
real 6m2.139s
user 2m44.390s
sys 0m3.210s

run 2:
real 6m57.140s
user 2m47.050s
sys 0m3.560s

kswapd CPU time: 20 seconds
qs RSS never above 204M, average value 150M.


------------- qs.c ---------------
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
#include <malloc.h>
#include <time.h>

int cmp(const void * x, const void * y)
int *a, *b;

a = (int *)x;
b = (int *)y;

if (*a == *b)
return 0;
if (*a > *b)
return 1;
return -1;

int main(int argc, char *argv[])
int *a, n, i, errors = 0;

n = atoi(argv[1]);

if ((a = malloc(sizeof(int) * n)) == NULL) {
for (i = 0; i < n; i++)
a[i] = rand();

qsort(a, n, sizeof(int), cmp);

for (i = 0; i < n - 1; i++)
if (a[i] > a[i + 1])
printf("%d errors.\n", errors);
return 0;
----------------- qs.c -----------------

To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to
More majordomo info at
Please read the FAQ at

 \ /
  Last update: 2005-03-22 13:03    [W:0.038 / U:0.108 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site