Main BLOGGER
Google
WWW THIS BLOG
Friday, February 03, 2006
 
Native STL container performace testing
Be careful of the STL containers, they are NOT standard in terms of performance.

Some testing result (Thanks to Ajith)

Testing Environment
Hardware: IBM blades Dual CPU Xeon 2.8G, 2.5G memory
1. Windows Server 2003
2. Linux 2.6 glibc 2.3

Conclusions. Eventhough Windows STL is slower than Linux, we can still push 1 million elements into a list in 1/2 a second. This doesn't seem like a significant issue.

Linux list.size() is really slow. 1 million size calculations on a 1 million element list would take 2 hours. On Windows it would be 3ms.

Linux Release mode is two times faster than debug mode.
Benchmarks: 1 Million element list
Windows list is 4-5 times slower than Linux list in release mode, 2-3 times slower in debug mode.

Linux size() is completely broken.
Release Mode Windows
Push Back : 455,708us
Size : 2,895us
Pop Back : 393,674us
Push Front : 456,519us
Pop Front : 384,902us
Release Mode UNIX
Push Back : 100,464us
Size : 8,000,000,000us (est. over 2 hours)
Pop Back : 54,065us
Push Front : 61,269us
Pop Front : 53,361us
Debug Mode UNIX
Push Back : 172847us
Size : 11,200,000,000us (est. over 2 hours)
Pop Back : 80,081us
Push Front : 118,254us
Pop Front : 82,967us

Here are the results for MAP - 1 million items. Map is a bit slower on Windows.
Windows Release Mode
Insert : 2,314,187us
Size : 2,609us
Erase : 573,573us
Linux Debug Mode
Insert : 1,202,102us
Size : 9,206us
Erase : 182,477us





<< Home

Powered by Blogger

Google
WWW THIS BLOG