Fork me on GitHub
#malli
<
2023-11-25
>
roklenarcic18:11:20

Would it be possible to precompile malli or something?

(time (require 'malli.dev))
"Elapsed time: 2972.572124 msecs"
It’s quite an expensive thing to load it.

bocaj19:11:58

For loading in development time or for production use?

Alex Sky19:11:04

(time (require ')) "Elapsed time: 302.174125 msecs" :thinking_face:

bocaj19:11:00

What about using criterium?

Alex Sky19:11:02

it's not about criterium or some benchmarks test as I understand it. Probably a local problem?

bocaj19:11:20

Yeah I’m assuming precompiling a dev namespace removes advantage of late binding while using the repl. If used in production would be compiled anyway.

ikitommi07:11:50

I've been asking robust tools for AOTing libraries for years. There are ways to do this, but I have not found anything that is robust: • https://clojure.org/guides/dev_startup_timehttps://clojureverse.org/t/deploying-aot-compiled-libraries/2545 Please share if you find a way to precompile malli that just works

ikitommi07:11:18

user=> (time (require '[malli.core]))
"Elapsed time: 409.494875 msecs"

ikitommi07:11:01

user=> (time (require '[clojure.core.async]))
"Elapsed time: 1615.888209 msecs"

ikitommi07:11:48

spec is precompiled by the core team, so:

user=> (time (require '[clojure.spec.alpha]))
"Elapsed time: 0.202042 msecs"

roklenarcic16:11:29

I don’t know what to tell you, takes almost 3 seconds on my Macbook pro 2019. Between Malli, tick with another 1.6sec load, clojure data xml with another 1.5sec load, it takes 10 sec to just load dependencies for my very simple command line utility.

roklenarcic16:11:48

It’s a real bummer

ikitommi17:11:21

I hear you. You can always ask Clojure Core team for help here. For command line, I would recommend #CLX41ASCS, much snappier.