Reducing Genie latency

After running

git clone https://github.com/GenieFramework/Genie.jl.git
cd Genie.jl

I run GENIE_ENV=prod julia --project=. and ]instantiate.

Then I can run the web server.

julia> using Genie; route(()->"hello world", "/"); up()

Benchmarking

% hyperfine --warmup 1 -- 'curl 127.0.0.1:8000/'
Benchmark #1: curl 127.0.0.1:8000/
  Time (mean ± σ):      14.9 ms ±   0.2 ms    [User: 2.2 ms, System: 1.4 ms]
  Range (min … max):    14.8 ms …  15.8 ms    161 runs

shows that it takes 15 ms to respond (after warmup), compared to <5 ms in Python frameworks.

I tried using Profiler and flamegraphs but I was confused by at least two things: 1) the server is a long-running process, so I’m not sure how to profile its responses to requests separately from waiting for the next request. 2) The server process uses Distributed to distribute responses to workers and I don’t know to account for the multiple tasks. More generally, I’m not totally sure how to interpret what I see in the graphs.

The author of Genie has labeled it “help wanted”. How would a Julia profiling expert get into this issue?

15 ms is nice to me…

1 Like

In real world that will not be the case.

Can you please do a concurrency load test and post it here? Or Have you seen any benchmark on genie.jl concurrency test, please share.

1 Like