Skip to content

Instantly share code, notes, and snippets.

@scriptum
Created September 24, 2013 14:57
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save scriptum/6686009 to your computer and use it in GitHub Desktop.
Save scriptum/6686009 to your computer and use it in GitHub Desktop.
Hash tables speed in different languages
$ make
/usr/bin/time -f "Time:\t%e\nMemory:\t%M" php test.php
Time: 0.59
Memory: 655984
/usr/bin/time -f "Time:\t%e\nMemory:\t%M" perl test.pl
Time: 0.64
Memory: 353456
/usr/bin/time -f "Time:\t%e\nMemory:\t%M" python test.py
Time: 0.92
Memory: 544240
/usr/bin/time -f "Time:\t%e\nMemory:\t%M" lua test.lua
Time: 2.03
Memory: 510208
/usr/bin/time -f "Time:\t%e\nMemory:\t%M" ruby test.rb
Time: 2.70
Memory: 577392
/usr/bin/time -f "Time:\t%e\nMemory:\t%M" ./cpp.out
1000
Time: 0.81
Memory: 349936
/usr/bin/time -f "Time:\t%e\nMemory:\t%M" ./c.out
Time: 0.42
Memory: 544144
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment