Following on from my note in “What HTTP server library to use” when I mentioned
next.jdbc to @ikitommi, here’s some very preliminary data from
next.jdbc – the next generation JDBC library I’m working on.
clojure.java.jdbc (provided originally by @ikitommi) – this is comparing the fastest equivalent operation from
clojure.java.jdbc with the raw Java equivalent:
Repeated reducible query with raw result set... Evaluation count : 206718 in 6 samples of 34453 calls. Execution time mean : 3.223544 µs ... Raw Java... Evaluation count : 511584 in 6 samples of 85264 calls. Execution time mean : 1.190587 µs
So it’s 2.7x slower than the Java code.
Here’s the very first, raw
next.jdbc version out of the box with no tweaks at all:
Evaluation count : 267834 in 6 samples of 44639 calls. Execution time mean : 2.272091 µs
So that’s 1.9x slower than raw Java.
And these are both in the pathological case of a very small in-memory database with just four records (and selecting by a non-index column to find the first matching row) – so the overhead of the library is deliberately magnified.
Also, a basic select of just the first matching result in
clojure.java.jdbc returning a full hash map took about 6.4 µs in
clojure.java.jdbc and takes about 4.2 µs in
next.jdbc (and you get qualified column names automatically in the latter).
It’s all still very much “hammock work” right now with minimal actual code, but the core functionality is being proved at this point.