(ns foo.bar
(:require
[planck.core :refer [line-seq *command-line-args*]]
[<http://planck.io|planck.io>]
[cljs-time.coerce :as t]
[cljs-time.format :as tf]
[cljs-time.core :as time]))
$ time planck -c/Users/matthew/.m2/repository/com/andrewmcveigh/cljs-time/0.4.0/cljs-time-0.4.0.jar test.cljs
planck test.cljs 6.96s user 0.27s system 134% cpu 5.355 total
That takes ~7s on my macbook pro.@mnewhook Interested in what happens if you add -K
or -k <path>
and run it twice (once to create cache and again to use it)
ah, you have to use -K each time?
I had already tried the cache but I didnβt realize you had to use -K to actually use the cache π
1s with the cache
much more reasonable.
Cool, yes. Cache has always been an opt-in feature for Planck, for better or worse.
it would be nice if it used the cache automatically if it is there.
Yeah, there are probably some imrovements to make caching more implicit
FWIW I like that cache is opt-in, as it could swallow e.g. undeclared var errors when using Planck aggressively at development time
Good point
so it definitely depends on the use case. So far it doesnβt bother me to specify -K
or -`k`whenever I want it to use caching
e.g.: planck -Kc <classpath goes here>
is not troublesome at all!
(There are some bugs regarding cache like https://github.com/mfikes/planck/issues/227 and https://github.com/mfikes/planck/issues/293)
@mfikes could #293 be related to a corrupted cache?
Yeah, perhaps the exit botches it
I think there was a fix in the CLJS compiler for that
on the JVM side, ofc
Oh, perhaps it is no longer reproducible then π
perhaps it could be more obvious in the documentation that -K is also necessary to use the cache. > The first time you run Planck this way, it will save the results of compilation into .planck_cache. Then subsequent executions will use the cached results instead. Perhaps instead: The first time you run Planck this way, it will save the results of compilation into .planck_cache. Then subsequent executions with -K will use the cached results instead.
@mnewhook Yes, the documentation can definitely be fixed. π
I agree it can be interpreted to just use it if it exists π
@mnewhook Thanks! https://github.com/mfikes/planck/commit/139e065a87b6ad6b1c2e96dac61ad56c533a5931