Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

268
Visualizações
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 Respostas
Responde à pergunta

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 Relatório
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda