Created
May 16, 2014 16:36
-
-
Save springmeyer/d29c754fd8cf6cb23af5 to your computer and use it in GitHub Desktop.
stupid simple array allocation benchmark from https://github.com/mapnik/mapnik/blob/master/benchmark/test_array_allocation.cpp
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ ./benchmark/out/test_array_allocation --threads 10 --iterations 10000 | |
calloc: t:10 i:10000 1620 milliseconds | |
malloc/memcpy: t:10 i:10000 1610 milliseconds | |
malloc/memset: t:10 i:10000 2360 milliseconds | |
new: t:10 i:10000 2000 milliseconds | |
vector(N): t:10 i:10000 5900 milliseconds | |
vector/resize: t:10 i:10000 4240 milliseconds | |
vector/assign: t:10 i:10000 5950 milliseconds | |
std::string range: t:10 i:10000 3110 milliseconds | |
std::string &[0]: t:10 i:10000 1680 milliseconds | |
valarray: t:10 i:10000 5600 milliseconds | |
static_vector: t:10 i:10000 1610 milliseconds |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment