Nat! bio photo


Senior Mull.

Twitter RSS


Zerofilling - The results Part I

As I've been slacking (due to the heat wave here probably), this is the first real update in quite some time. I asked you to send in some benchmark results and indeed I got a nice feedback. In this first part I will just quickly talk about what has been measured, and give the reported data the second part will interpret the data.

What the code measures

The code is doing the following. First it will do a little warm up, doing some allocations untimed. This gives the memory system a chance to prepare for what is coming :)

The program will then do a million operations of vm_allocate and vm_deallocate to factor out the overhead for allocation an deallocation, since the primary interest of this benchmark is the page faulting (with the zero filling). The reason 1 mio operations are done, is so that the runtime can be easily converted into us/operation. A runtime of 10s means 10us per iteration.

The first loop just does vm_allocate() and vm_deallocate(). The second does the same thing, except touches a single page within the allocation. This triggers a fault, a vm_object() allocation, and zero-fill. Then when we call vm_deallocate(), there is additional work to free the page and the object. The third loop allocates and frees two pages, akin to the first loop. Finally, the fourth loop does the same for 2 pages per allocation, isolating out the per-page costs (fault, zero-fill, and free).


The measured results

I had to name one entry Anonymous because it was submitted with 10.3 and AFAIK that's already problematic with Apple's touchy-feely lawyers...
CPU/ Machine OS Submitter
1p alloc 1p alloc + fault 2p alloc 2p alloc + fault
1.25GHz G4 (167MHz system bus)   unknown Jim Magee
9.03s 18.13s N/A 24.58s
1 GHz G4 10.2.6 F.Inci
11.2s 24.0s 11.5s 33.6s
867 MHz G4 (Powerbook) 10.2.6 F. Inci
16.5s 34.5s 17.0s 47.7s
500 MHz G4 10.3 Anonymous
14.9s 39.4s 14.9s 50.5s
800 MHz G4 (iMac) 10.2.6 H. Hess
16.4s 47.7s 17.8s 71.4s
450 MHz G4 (Cube) 10.2.6 Nat!
18.1s 51.2s 18.5s 75.1s
500 MHz G3 (IBook) unknown  R.Lutz
21.2s 59.8s 22.1s 84.4s