Date: Sat, 14 Feb 2004 17:26:53 +0100 From: Radim Kolar <hsn@netmag.cz> To: freebsd-performance@freebsd.org Subject: realloc (using forkbomb) benchmark results Message-ID: <20040214162653.GA556@asura.bsd>
next in thread | raw e-mail | index | archive | help
I have tested memory allocation speed in Linux and FBSD with ports/benchmark/forkbomb. This test is doing realloc(1M) realloc(2M), ... Results are: -M writes into allocated memory, -m don't freebsd 5.2 ./forkbomb -l 64 -i 256 -M --quit 16.77s user 21.38s system 98% cpu 38.591 tota l ./forkbomb -l 64 -i 256 -m --quit > /dev/null 16.12s user 31.30s system 98% cpu 48.329 total Linux/glib2.3.2 (hsn@tty2):~/forkbomb% time ./forkbomb -l 64 -i 256 -m --quit > /dev/null 19:22 ./forkbomb -l 64 -i 256 -m --quit > /dev/null 0.00s user 0.00s system 0% cpu +0.000 total (hsn@tty2):~/forkbomb% time ./forkbomb -l 64 -i 256 -M --quit > /dev/null 19:24 ./forkbomb -l 64 -i 256 -M --quit > /dev/null 0.02s user 0.59s system 96% cpu +0.634 total Results shows: a) FBSD uses too much user time: can't extend last block while realloc()ing without copying it to other place. This should be easy to fix. b) if FBSD writes to allocated memory, results are better! Comments? c) if linux don't writes into memory, it doesn't do anything. d) linux has remap() syscall which is used for memory resizing in realloc() e) Linux uses mmap() for allocating block much larger than page. FreeBSD is doing brk() allocation. f) freebsd brk() vs linux remap() is 31 vs 0.6 sec.
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20040214162653.GA556>