Add levensthtein for Clojure and Babashka (and Java for good measure) #234
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
The Clojure and Java solutions are not as close to C's as with the other benchmarks, but still decent.
Java:
Clojure:
It's too few runs to draw any conclusions about the difference between these two. But we can assume that there is a small overhead for Clojure in about the amount indicated.
Start times again
Of course, with this benchmark it gets even more obvious that we need to do something to mitigate for the start times of the languages. Because running this with hyperfine:
So while Java and Clojure may be some 2-3 times slower than C on this algorithm. The benchmark makes it look more like 10X and 50X, respectively... Related:
The new
run.sh
needs attentionWhile adding this I noticed that the new
run.sh
fails to check file existence for Java and Clojure (and probably a lot of other languages too). It can't be assumed that the argument to the command for running the program is a file. To solve it so that I could run the benchmark for the languages I added I used this:So, introducing the file to check for as the second parameter to
run
.Separate Babashka and Clojure code
Note that this has separate code for Clojure and Babashka, so this PR is related: