Created
June 5, 2009 04:09
-
-
Save thinca/124047 to your computer and use it in GitHub Desktop.
This file contains 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
let list = [] | |
echo 'call add(list, i)' | |
let time = reltime() | |
for i in range(10000) | |
call add(list, i) | |
endfor | |
echo reltimestr(reltime(time)) | |
let list = [] | |
echo 'let list += [i]' | |
let time = reltime() | |
for i in range(10000) | |
let list += [i] | |
endfor | |
echo reltimestr(reltime(time)) | |
let list = [] | |
echo 'let list = list + [i]' | |
let time = reltime() | |
for i in range(10000) | |
let list = list + [i] | |
endfor | |
echo reltimestr(reltime(time)) | |
let list = [] | |
echo 'call insert(list, i)' | |
let time = reltime() | |
for i in range(10000) | |
call insert(list, i) | |
endfor | |
echo reltimestr(reltime(time)) | |
let list = [] | |
echo 'let list = [i] + list' | |
let time = reltime() | |
for i in range(10000) | |
let list = [i] + list | |
endfor | |
echo reltimestr(reltime(time)) | |
finish | |
=> result (Intel Core2 2.40GHz + 2.00GB RAM) | |
call add(list, i) | |
0.066588 | |
let list += [i] | |
0.070910 | |
let list = list + [i] | |
14.713714 | |
call insert(list, i) | |
0.069628 | |
let list = [i] + list | |
15.083124 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment