Open sstangl opened 1 month ago
This is the first non-trivial Go code I've written, so please be skeptical if something looks unidiomatic. It would be nice to have a benchmark for this in the test suite -- if there's a preferred entrypoint for loading the DB and performing searches, please let me know.
I benchmarked this by manually disabling the server's cache and investigating /leaderboard
. Performance seems largely unchanged, maybe slightly faster, but the majority of overhead appears to be elsewhere. Response times are extremely variable in both development
and this branch, between 7ms and 60ms, although I haven't investigated enough to blame GC yet.
I'm going to leave this open while I crack on with the lower-hanging fruit this week as jet-lag will be seeping into my grey matter very shortly.
Check out the benchmarking suite in Go (testing.B), I've used it a bunch on other projects and it's super handy at measuring these sort of improvements.
I'll create an issue for myself to tidy some stuff up to allow for easier benchmarking without having to do it manually.