Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

265
Views
How to minify a large finite collection of strings?

I am creating a Trie in memory. Each node contains is a word. It is extremely good performance-wise. But the catch is the memory consumption.

It is 6GB big! I serialized it with protobuf and wrote it to a file that came out to be 150MB.

JSON is 250MB. I was hoping if there is a way to minify the strings? For eg:

enter image description here

As you can see there are duplicates in the first column. Also, it should be reversible.

All the properties/columns are string.

So let's say the table gets converted to :

enter image description here

I think that would save a lot of space. Of course I can do this by inserting each cell in a dictionary first and then assigning it an integer but I do not want to reinvent the wheel unless I have to.

over 4 years ago · Santiago Trujillo
1 answers
Answer question

0

The idea you want to do is creating a dictionary first with all and than change actual values to dictionary key (that will be smaller).

This approach is used in Zip and other compress algorithms.

over 4 years ago · Santiago Trujillo Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!