-
-
Save sunng87/1823954 to your computer and use it in GitHub Desktop.
Evaluating clojure literals in ruby and python
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
import clj | |
import time | |
s = "[1 2 3 true false nil {:a 21.3 :b 43.2} \"Hello\"]" | |
t1 = time.time() | |
for i in range(10000): | |
clj.loads(s) | |
print time.time()-t1 |
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
require 'clj' | |
s = "[1 2 3 true false nil {:a 21.3 :b 43.2} \"Hello\"]" | |
t1 = Time.now() | |
for i in 0...10000 | |
Clojure.parse(s) | |
end | |
puts Time.now()-t1 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment