All Topics
All Topics
Technology
Technology
Design
Design
Programming
Programming
Science
Science
News
News
Gaming
Gaming
Entertainment
Entertainment
Business
Business
Finance
Finance
Sports
Sports
Health
Health
Food
Food
Travel
Travel
Art
Art
Music
Music
Books
Books
Education
Education
Politics
Politics
Personal
Personal
No algorithm. No AI slop. No ads. Just RSS. Pro-human. Indie writers. Real journalism. Open web. Chronological. Hand toasted.

How replacing a 3 GB SQLite database with a 10 MB FST binary achieved a 300x memory reduction for a Finnish-English dictionary

By

hiAndrewQuinn

21d ago· 8 min readenInsight

Summary

A developer describes replacing a 3 GB SQLite database for a Finnish-English dictionary with a 10 MB finite state transducer (FST) binary, achieving a ~300x memory reduction. The article details the technical journey of moving from a hacked-together database solution to a specialized, static data structure optimized for incremental search. Key insights include using FSTs for efficient string lookup, the trade-offs between dynamic databases and static specialized structures, and the importance of choosing the right tool for specific use cases rather than defaulting to familiar solutions.

Key quotes

· 3 pulled
It's much more valuable to walk away with the heuristic 'some dude got a 300x memory reduction by swapping out a database he hacked together for a tiny, static, specialized data structure that does exactly what he needs it to and no more.'
I found myself with an increasingly rare opportunity to work this weekend on Taskusanakirja, also often called tsk, a Finnish-English dictionary with incremental search
All numbers have been rounded to their first significant digit, because I'm a fan of Rob Eastaway's 'zequals' method of getting to the point when it comes to estimation.
Snippet from the RSS feed
Note for numberphiles: all numbers have been rounded to their first significant digit, because I’m a fan of Rob Eastaway’s “zequals” method of getting to the point when it comes to estimation. It’s much more valuable to walk

You might also wanna read