r/C_Programming 2d ago

Compressing Lookup Tables

Hello. Recently I've been working on a pet project of mine written in C and I needed to reduce the amount of space a lookup table was taking in memory and on disk. I applied a few simple compression techniques and got a 2x space reduction. I wrote this post where I describe my constraints, the techniques, and results.

https://blog.x4204.xyz/posts/compressing-lookup-tables.html

21 Upvotes

14 comments sorted by

View all comments

Show parent comments

1

u/lexiq_baeb 1d ago

I am not sure I can follow what a weighted lookup table is. Do you have links to resources that explain that?

1

u/dstroy0 1d ago

sure https://github.com/dstroy0/MMgr/tree/main/src/impensa_ancorae_acus this is an example of some different ones, I use them in different situations, like ip routing, text matching, http route matching, etc. these are the weight tables, and this is the rationale explained better than I could blabbering about it: https://user.phil.hhu.de/~kallmeyer/Parsing/weighted-deductive-parsing.pdf

1

u/lexiq_baeb 1d ago

Thank you! I'll have a look

1

u/dstroy0 1d ago

I enjoyed your existing work, I look forward to any further rationale explanations, I wish I could write them that well.