Skip to content
This repository has been archived by the owner on Jun 4, 2022. It is now read-only.

Execution speed of lumo compared to Clojure #526

Open
bender647 opened this issue Jan 25, 2022 · 0 comments
Open

Execution speed of lumo compared to Clojure #526

bender647 opened this issue Jan 25, 2022 · 0 comments

Comments

@bender647
Copy link

This year I used lumo for Advent of Code, as I'm familiar with Javascript (and not Java), and like the philosophy of starting up quickly and having no clutter in your working directory.

However, there were a couple problems I was stuck on, trying to get my execution times down. For kicks, I tried running the same scripts in Clojure (on the JVM) and saw 7X speed improvement in the cases I tried.

I wanted to check if this was to be expected.

Just a quick test, using the latest Lumo pre-built linux binary:

Lumo 1.10.1
ClojureScript 1.10.520
Node.js v11.13.0
 Docs: (doc function-name-here)
       (find-doc "part-of-name-here")
 Source: (source function-name-here)
 Exit: Control+D or :cljs/quit or exit

cljs.user=> (time (dotimes [c 10000000] (sort [2 4 1 8 7 9])))
"Elapsed time: 30364.978216 msecs"
nil
cljs.user=> (time (dotimes [c 10000000] (sort [2 4 1 8 7 9])))
"Elapsed time: 30977.397318 msecs"

Latest downloaded Clojure (usually the first initial run times will be slower, then they speed up significantly and stay fast):

Clojure 1.10.3
user=> (time (dotimes [c 10000000] (sort [2 4 1 8 7 9])))
"Elapsed time: 5548.512002 msecs"
nil
user=> (time (dotimes [c 10000000] (sort [2 4 1 8 7 9])))
"Elapsed time: 6451.64772 msecs"
nil
user=> (time (dotimes [c 10000000] (sort [2 4 1 8 7 9])))
"Elapsed time: 11067.288896 msecs"
nil
user=> (time (dotimes [c 10000000] (sort [2 4 1 8 7 9])))
"Elapsed time: 3167.670393 msecs"
nil
user=> (time (dotimes [c 10000000] (sort [2 4 1 8 7 9])))
"Elapsed time: 3114.163477 msecs"
nil
user=> (time (dotimes [c 10000000] (sort [2 4 1 8 7 9])))
"Elapsed time: 3131.076725 msecs"
nil

And org.clojure/clojurescript:

Waiting for browser to connect to http://localhost:9000 ...
ClojureScript 1.10.758
cljs.user=> (time (dotimes [c 10000000] (sort [2 4 1 8 7 9])))
"Elapsed time: 20111.500000 msecs"
nil
cljs.user=> (time (dotimes [c 10000000] (sort [2 4 1 8 7 9])))
"Elapsed time: 19918.300000 msecs"
nil
cljs.user=> (time (dotimes [c 10000000] (sort [2 4 1 8 7 9])))
"Elapsed time: 20111.500000 msecs"
nil

I'm wondering perhaps if there is something I'm doing wrong (like not compiling the source?)

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant