Liking cljdoc? Tell your friends :D

Performance

Hermes benefits from the speed of Apache Lucene and LMDB, and from fundamental design decisions including read-only operation and memory-mapped data files. It provides a HTTP server using the Jetty web server.

Benchmarks

Measured against the SNOMED CT International Edition on a MacBook Pro M1 (2021), JVM 17, running from source.

In-process (Clojure API)

Measured with criterium.

OperationMeanNotes
Concept lookup0.82 ushermes/concept by SCTID
Bulk lookup (15 concepts)14.6 usSequential hermes/concept x 15
Free-text search141-184 ushermes/search, 10 results
All children230-243 ushermes/all-children, ~121-125 descendants
All parents19-69 ushermes/all-parents, 10-32 ancestors
Subsumption test13-69 ushermes/subsumed-by?

HTTP API (single client)

Measured with wrk.

OperationMean latencyThroughput
Concept lookup59 us15,546 req/s
Extended concept364 us2,663 req/s
Concept descriptions81 us11,891 req/s
Free-text search (10 results)292-378 us2,642-3,312 req/s
Subsumption test81 us11,801 req/s

HTTP API (concurrent load)

OperationConnectionsThroughputp50 latency
Free-text search ("heart attack")5027,392 req/s0.93 ms
Concept lookup5086,167 req/s311 us
Free-text search ("mnd")30033,848 req/s9.74 ms

Load testing

You can reproduce these results with wrk:

# Start the server
hermes --db snomed.db serve

# Search under load
wrk -c300 -t12 -d30s --latency 'http://localhost:8080/v1/snomed/search?s=mnd'

# Concept lookup under load
wrk -c50 -t4 -d10s --latency 'http://localhost:8080/v1/snomed/concepts/24700007'

# Subsumption under load
wrk -c50 -t4 -d10s --latency 'http://localhost:8080/v1/snomed/concepts/24700007/subsumed-by/6118003'

Why is it fast?

  • LMDB maps the database directly into the process's address space via mmap. Concept lookups are pointer dereferences, not queries — no SQL parsing, no network round-trips to a database server.
  • Apache Lucene provides the same search technology used by Elasticsearch, but embedded — no cluster coordination, no HTTP between search and application.
  • Read-only operation means no write-ahead logs, no locks, no transaction overhead. Multiple processes can share the same memory-mapped files.
  • Single process eliminates network latency between services. A concept lookup that takes 59 microseconds over HTTP would take milliseconds if it involved a query from the application to a separate database process.

Scaling

Given its design, hermes scales easily:

  • Vertically: A single instance handles thousands of concurrent users.
  • Horizontally: Run multiple instances on the same read-only database volume. Memory-mapped files are shared by the OS page cache, so each additional instance adds minimal memory overhead.

In real deployments, a single instance has been sufficient for hundreds of concurrent users.

Can you improve this documentation?Edit on GitHub

cljdoc builds & hosts documentation for Clojure/Script libraries

Keyboard shortcuts
Ctrl+kJump to recent docs
Move to previous article
Move to next article
Ctrl+/Jump to the search field
× close