Closed schoettl closed 3 years ago
@schoettl Very good point. Thanks for pointing us at that! We're looking into it. So far I can say:
lein test
takes 6s on my machine.@schoettl All good now. lein test
is back to running in <6s on my machine. Thanks for the bug report :pray:
Wow, thanks for fixing it! I don't understand the fix at all :D I really have to learn basics of clojure some day ^^
@schoettl Sure, you’re welcome^^
The fix was quite trivial after we saw what’s slow. We started with benchmarking all tests (the reverted commit yields the comment above) and saw that all parser tests are slow now. Then, we checked what the last commit with fast tests were by bisecting. We looked at the diff and saw that only code, no EBNF was changed. Then, we used visualvm to profile the codebase and found the culprit. All time was spent in one function.
The change introduced on the commit was to use a function with defn
vs. a static car with def
. One gets evaluated on every call, one only once. There’s no need to parse the EBNF every time, once on startup is quite enough, so the right way is a def
.
lein test (specifically parser-test) takes more than 2,5 minutes to finish.
Is there a possibility to speed this up? Even in Emacs with cider and a connected repl, running this tests takes minutes.