Make Ubuntu packages 90% faster by rebuilding them
Published on: 2025-06-10 12:55:17
Make Ubuntu packages 90% faster by rebuilding them
You can take the same source code package that Ubuntu uses to build jq, compile it again, and realize 90% better performance.
Setting
I use jq for processing GeoJSON files and other open data offered in JSON format. Today I am working with a 500MB GeoJSON file that contains the Alameda County Assessor's parcel map. I want to run a query that prints the city for every parcel worth more than a threshold amount. The program is
.features[] | select(.properties.TotalNetValue < 193000) | .properties.SitusCity
This takes about 5 seconds with the file cached, on a Ryzen 9 9950X system. That seems a bit shabby and I am sure we can do better.
Step 1: Just rebuild the package
What happens if you grab the jq source code from Launchpad, then configure and rebuild it with no flags at all? Even that is about 2-4% faster than the Ubuntu binary package.
We are using hyperfine to get repeatable results. The jq program is being constrained on log
... Read full article.