Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!oakhill!nddsun1!dover.sps.mot.com!mathys From: mathys@dover.sps.mot.com (Yves Mathys) Newsgroups: comp.sys.apollo Subject: Stay away from DOMAIN/OS malloc Message-ID: <866@nddsun1.sps.mot.com> Date: 26 Feb 91 18:23:35 GMT Sender: root@nddsun1.sps.mot.com Reply-To: mathys@dover.sps.mot.com (Yves Mathys) Organization: Motorola, Inc., Semiconductor Systems Design Technology SPS Lines: 95 Stay away from Domain/OS malloc ! Intrigued by an abnormal slow down of a circuit simulator on Apollo, I did some testing on the 'malloc' package. I am surprised how *bad* it is ! Up to 50 times slower than GNU malloc ! The test consisted of a small application requesting and freeing memory up to 10 Megabytes on a 16 Megabytes system. I also ran a memory intensive circuit simulation. I tested out three ways of allocating memory: o Domain/OS malloc package (default) o GNU malloc o Aegis heap allocation (rws_$) I run the test program using the default Display Manager and also using X owning the display, surprisingly, in the X mode the Domain/OS malloc package almost collapsed ! when GNU malloc is a bit longer to allocate 10 Megabytes. The first test asks for 4 Megabytes, the default package forces the system to do a lot of swapping to get the memory even though there is 16 Megabytes available of RAM. Doing the same test on a SUN3 reports that SUN took care of their allocation package algorithm (see below), knowing it is going to affect many applications, what Apollo simply ignored. Using GNU malloc made a circuit simulation allocating a lot of memory run 3 times faster, simply by limiting swapping. I am aware that my test case does not fully evaluate the malloc package but I am convinced that the Domain/OS malloc package is really poor. Results: ======= test1 test2 test3 ====================================================== Dom/OS 4 50 5 Dom/OS(X) 60 104 5 GNU alloc 2 2 6 GNU alloc+X 2 14 9 AEGIS (rws_(heap)) 3 12 31 ------------------------------------------------------- SUN 3 3 4 7 SUN 3 GNU alloc 3 5 13 ------------------------------------------------------ SPICE circuit simulator ----------------------- Domain/Os GNU ------------------------------------------------------ b330 950/398/32(+) 309/395/6 ------------------------------------------------------ (+) output of /bin/time test1 : request 4 Megabytes in 1<