sci
sci copied to clipboard
Optimize static method calls
user=> (def f (sci/eval-string "(fn [] (Math/sin 3.14))" {:classes {'Math Math}}))
#'user/f
user=>
user=> (defn foo [] (Math/sin 3.14))
#'user/foo
user=> (time (dotimes [i 1000000] (f)))
"Elapsed time: 2171.718646 msecs"
nil
user=> (time (dotimes [i 1000000] (foo)))
"Elapsed time: 18.466058 msecs"
nil