Get the latest tech news

Quadrupling code performance with a "useless" if


So I was optimizing a domain-specific compressor the other day, as one does. One important problem was chunking the input string and optimally choosing the most compact encoding for each chunk (different encodings compress different characters better, so where to split is not immediately obvious). The previous post describes the algorithm if you’re interested, but it boils down to finding the shortest path on a grid. For each cell, the algorithm computes the best cell following it. Following references from the first cell to the last one gives the optimal coding order.

None

Get the Android app

Or read this on Hacker News

Read more on:

Photo of code performance

code performance

Related news:

News photo

Algos and Code Performance: Your Code Works but Can It Handle Real Traffic?