-
Notifications
You must be signed in to change notification settings - Fork 1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Reduce binary size #21
Comments
Looking back to this, I've come up with some ideas:
Out of these, I'm right now most intrigued by the third option, as it would cut the amount of data into a third right away and provides an extensible base for future needs. I'll give it a try. |
It's quite cumbersome to try to read an SQLite database that's embedded in the binary. I might come back to this approach later, but for now I'll just compress the JSON files with |
Compressing the JSON files results in the binary shrinking from 121MB to 32MB... however, this also results in a hefty performance degradation:
compared to
Slowing down the quick CLI lookup usecase by 50% is a dealbreaker. I'll figure out something else. |
I keep thinking moving from JSON files to SQLite would most likely be a big improvement here, in addition to being more flexible in other ways. |
As of now
jisho
is a quite large binary, as no effort whatsoever has been spent in optimizing for binary size.However, it looks like Rust tooling has (recently?) grown more aware of binary sizes, and trying to update the embedded JMdict version to a more recent version triggered some built-in size limit of Crates.io. The JSON files derived from JMdict are certainly much more verbose than necessary, so this should be relatively easy to fix.
The text was updated successfully, but these errors were encountered: