Decision: Implementation in Go
The ebk-find program will be rewritten from Python to Go.
The name of the program will be changed to “ebk-select” to reflect the use case,
rather than the mechanism and its similarity to find, fzf, etc.
ebk-find will be archived once the reimplementation reaches feature parity.
Expected benefits
-
The output is a standalone single-file binary, which is easier to distribute and install than a Python wheel, which requires the user to manage a virtual environment or OS-specific tools to convert it to a native package.
-
It should run faster, and with no type-related bugs, thanks to type checking at compile time.
-
It should be possible to reduce the memory usage, since the language makes it easier to control memory allocation.
Benchmark results
The Python and Go versions were benchmarked
on synthetic libraries in a range of sizes up to 50 000 books.
The following plots show the execution time and peak memory usage
of the last Python version (ebk-find v0.4.3) and two versions of ebk-select.
The initial Go implementation ran faster and used less memory than ebk-find,
confirming that the reimplementation delivers the expected benefits.
The benchmarks were repeated after caching had been implemented in ebk-select.
This showed further improvement in both time and memory use:
even the largest of personal libraries can be now searched in less than 150 ms,
while using less than 25 MiB.