4 ms·
So obvious, trade-off space for time, yet I wouldn't have thought of it... I mean, I've thought about this problem, written a persistent JVM solution, and didn'
by 6ren 14y ago
So obvious, trade-off space for time, yet I wouldn't have thought of it... I mean, I've thought about this problem, written a persistent JVM solution, and didn't think of it. Memory is cheaper than my intuition realises.
I wonder how many other "obvious" solutions I'm missing like this?
EDIT for the code I tried, user time is almost 3 times faster, but real time is only around 10% better... I don't understand linux well enough to know why - anyone care to explain please? EDIT Yes, drip had already run. (I picked typical times from about 10 runs each).
$ time java...
real 0m1.466s
user 0m1.216s
sys 0m0.180s
$ time drip...
real 0m1.378s
user 0m0.412s
sys 0m0.260s
BTW: For server-like workloads, an advantage of a persistent JVM is that it gets dramatically faster over repeated runs of the same code, as it improves its hotspot-style adaptive optimisations.
I really like his quickstart "standalone" installation.
WARNING "drip kill" crashed my system. The kill functions are kill_jvms and kill_jvm (https://github.com/flatland/drip/blob/develop/bin/drip https://github.com/flatland/drip/blob/develop/bin/drip). I'm using an older ubuntu 10.04 LTS.
- bretthoerner 14y agoDid you do two exact same drip runs in a row? It has to hash and preload a JVM with the same classpath setup to work. $ time java -jar clojure-1.3.0.jar add_1_and_1.clj real 0m0.690s user 0m0.827s sys 0m0.030s $ time drip -jar clojure-1.3.0.jar add_1_and_1.clj real 0m0.879s user 0m1.020s sys 0m0.040s $ time drip -jar clojure-1.3.0.jar add_1_and_1.clj real 0m0.177s user 0m0.033s sys 0m0.020s $ time drip -jar clojure-1.3.0.jar add_1_and_1.clj real 0m0.176s user 0m0.050s sys 0m0.017s