Memory Test



Here's a quick summary of a few memory speed tests I ran to get a feel for the over head incurred by our choice of in-memory formatting. The source for the tests is shown below.

The memory allocation tests allocated 1000 "complex" objects and then deleted them all.

The memory copy tests just copied one 5kB buffer to another. The time per event assumed only on copy of the 5kB buffer per event.

All values are in ms/event
Test Linux
(quad 2GHz xenon)
SunOS
(jlabs1)
Mac OSX
(dual 1GHz G4)
Linux
(1.2GHz celeron)
SunOS*
(clon10)
new/delete (no constructor) 0.12 0.52 0.87 0.25 1.41
new/delete (with constructor) 0.12 0.61 0.91 0.26 1.26
free/malloc 0.09 0.54 0.83 0.21 1.17
memcpy 0.0010 0.0061 0.0012 0.0010 0.0186
memmove 0.0018 0.0052 0.0011 0.0010 1.85
* Used the Sun WS 6 C++ compiler rather than g++.
Here's the source for the program:

mem_test.cc

It was compiled with:

g++ mem_test.cc -o mem_test.$OSNAME
David Lawrence
davidl@jlab.org
Last Updated