sci icon indicating copy to clipboard operation
sci copied to clipboard

Optimize static method calls

Open borkdude opened this issue 2 years ago • 0 comments

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

borkdude avatar Mar 19 '22 15:03 borkdude