Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 9 Dec 2001 12:57:48 +0200
From:      Dimitar Peikov <mitko@bgzone.com>
To:        hackers@freebsd.org
Subject:   Performance issue
Message-ID:  <20011209125748.3d326e32.mitko@bgzone.com>

next in thread | raw e-mail | index | archive | help
This is a multi-part message in MIME format.

--Multipart_Sun__9_Dec_2001_12:57:48_+0200_08221800
Content-Type: text/plain; charset=US-ASCII
Content-Transfer-Encoding: 7bit

Hi, It seems to me that something in memory allocation algorith is not right. When allocate memory using malloc() without touching it FreeBSD is faster than Linuxes. But when some access to this allocated memory is needed (in most cases when have to perform calculations on huge amount of data), something is going not very well. It happends that the same program with the same input data works a times slower than on Linux box. The hardware on both machines is the same, even more Linux box has less memory. And when swapping is going to transfer data from swap area into phisical memory, I think that the things are going much slower, I mean that FreeBSD is doing this slower. I'm trying to find the difference between both implementations on both allocation algorithms, to find the answer why the things are going so. If someone can explain me in more detail both swapping and allocation algorithms currently in use in FreeBSD (I've read /usr/src/lib/libc/stdlib/malloc.c and have compl!
 etely agreed with it, with 1 exception), please help me. 

PS:
   I'm not trying to compare both OS-es but I'm curious on this performance issue.

On FreeBSD 4.4 Stable from Nov 22 2001
--------------------------------------------
1000000 iterations without bzero :
FreeBSD$ time ./malloc_test 

real    0m5.706s
user    0m3.169s
sys     0m2.487s
--------------------------------------------
10000 iterations with bzero :
FreeBSD$ time ./malloc_test 

real    0m47.915s
user    0m12.369s
sys     0m34.681s
--------------------------------------------


On SuSE Linux host1 2.4.0
--------------------------------------------
1000000 iterations without bzero :
SuSE$ time malloc_test

real    0m14.417s
user    0m1.370s
sys     0m13.040s
--------------------------------------------
10000 iterations with bzero :
SuSE$ time malloc_test

real    0m34.364s
user    0m3.630s
sys     0m30.710s
--------------------------------------------

-- 
Dimitar Peikov
Programmer Analyst
Globalization Group
"We Build e-Business"  

RILA Solutions  
27 Building, Acad.G.Bonchev Str.  
1113 Sofia, Bulgaria  

phone: (+359 2) 9797320 
phone: (+359 2) 9797300 
fax:   (+359 2) 9733355  
http://www.rila.com 


--Multipart_Sun__9_Dec_2001_12:57:48_+0200_08221800
Content-Type: application/octet-stream;
 name="malloc_test.c"
Content-Disposition: attachment;
 filename="malloc_test.c"
Content-Transfer-Encoding: base64

I2luY2x1ZGUgPHN0ZGxpYi5oPgoKI2RlZmluZSBNQUxMT0NfU0laRSAxMDI0KjEwMjQKCmludCBt
YWluKGludCBhcmdjLCBjaGFyICoqYXJndikgewogIGNoYXIgKnB0cjEsICpwdHIyOwogIGludCBp
OwoKICBwdHIxID0gKGNoYXIgKikgbWFsbG9jKE1BTExPQ19TSVpFKTsKICBiemVybyhwdHIxLCBN
QUxMT0NfU0laRSk7CiAgZm9yIChpPTA7IGk8MTAwMDA7IGkrKykgewogICAgcHRyMiA9IChjaGFy
ICopIG1hbGxvYyhNQUxMT0NfU0laRSk7CiAgICBiemVybyhwdHIyLCBNQUxMT0NfU0laRSk7CiAg
ICBmcmVlKHB0cjEpOwogICAgcHRyMSA9IHB0cjI7CiAgfQogIGZyZWUocHRyMSk7Cn0K

--Multipart_Sun__9_Dec_2001_12:57:48_+0200_08221800--

To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-hackers" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20011209125748.3d326e32.mitko>