Performance self assessment
In the end, when I started to measure performance (in a non-scientific way), the numbers I was getting to interact with the webserver were mostly below 15ms. Unfortunately when looking at the Firefox console I've seen loading time go as high as 100ms (stays mostly on 50-60ms range). Most of the latency, (Firefox's loading time, network travel time, TCP handshakes etc...) is not something under my control.
At that point, I'm satisfied enough with the performances of the web server per se. I wont pursue the goal of increased performances any further (even though I have some ideas).
Below are the benchmarks I did. Those were conducted on a commodity hardware, specifically a DELL Latitude 5501 laptop. These benchmarks were executed on a linux virtual machine running under WSL2 in Microsoft Windows 10.
How long does it take to retrieve the main page?
To check the time it takes to retrieve the main page, the benchmark used was simply to compute the wall clock time
of running wget to dowload the main page.
shell> hyperfine "wget -q -O - 'http://localhost:3000/'"
Benchmark 1: wget -q -O - 'http://localhost:3000/'
Time (mean ± σ): 2.4 ms ± 0.5 ms [User: 1.4 ms, System: 0.4 ms]
Range (min … max): 1.6 ms … 6.1 ms 663 runs
It is to be noted that thes timings include the time it takes to start wget, create the request, make the
TCP handshake, post the request, receive the response, and report it. The server's log showed lower times
below one millisecond (reported at 0).
How long does it take to retrieve the data of a specific build?
The benchmarks are done by simply measuring the time it takes to run a request via wget. This is the data for the time it takes
to retrieve the data of a specific job:
shell> hyperfine "wget -q -O - 'http://localhost:3000/build/3'"
Benchmark 1: wget -q -O - 'http://localhost:3000/build/3'
Time (mean ± σ): 8.4 ms ± 0.4 ms [User: 1.5 ms, System: 0.4 ms]
Range (min … max): 7.5 ms … 11.2 ms 273 runs
How long does it take to retrieve the load the page to enter a build request?
The benchmarks are done by simply measuring the time it takes to run a request via wget. This is the data for the time it takes
to retrieve the add_job page.
shell> hyperfine "wget -q -O - 'http://localhost:3000/add_job'"
Benchmark 1: wget -q -O - 'http://localhost:3000/add_job'
Time (mean ± σ): 1.8 ms ± 0.4 ms [User: 1.4 ms, System: 0.3 ms]
Range (min … max): 1.3 ms … 4.7 ms 803 runs
How long does it take to post a job?
The benchmarks are done by simply measuring the time it takes to run a request via curl. This is the data for the time it takes
to add a job:
shell> hyperfine "curl 'http://localhost:3000/add_job' --compressed -X POST --data-raw '<all the parameters of the add_job method>' "
Benchmark 1: curl 'http://localhost:3000/add_job' --compressed -X POST --data-raw '<all the parameters of the add_job method>'
Time (mean ± σ): 15.6 ms ± 2.5 ms [User: 3.3 ms, System: 1.3 ms]
Range (min … max): 12.8 ms … 28.5 ms 199 runs
It is to be noted that thes timings include the time it takes to start curl, create the request, make the
TCP handshake, post the request, receive the response, and report it. The timings reported from the server's
log were consistently around 9 to 11 milliseconds with peaks at 13 milliseconds.