Update performance.md (and perhaps also add it to the homepage, so people can find it there too; not sure if it was "findable" on the homepage, I found it when I did a google search for "hexapdf tricks" and so forth #411
Replies: 1 comment
-
|
The gist evolved into the first of a couple of benchmarks, see https://hexapdf.gettalong.org/documentation/benchmarks/optimization.html for the optimization benchmark. Those are semi-regularly updated. Not much has changed since the original comparison. qpdf evolved quite a bit over the last years and managed to close the gap a bit, though HexaPDF still manages to have a bit better lossless compression. The main difference is that qpdf is faster than HexaPDF due to being written in C++, and got faster still over the years. With respect to memory usage they are roughly the same. I just ran the benchmark on my standard test files and since January 2025 qpdf (version 12.2.0 now instead of 10.4.0) got an impressive speed bump, processing the f.pdf in 5.7 and 6.6 seconds instead of 13.9 and 18.6, while HexaPDF stayed roughly the same (I already optimized HexaPDF in the beginning of its development and I'm afraid there isn't much more to optimize). If you clone the github repository, change into the As for i-love-pdf and most other such websites: They don't do lossless optimization but re-compress images to save space. This might be wanted in some cases but not in others. In theory HexaPDF could do the same by relying on JPEG optimization tools, it is just not implemented yet. |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Sers Thomas,
About 6 years ago you gave an overview of hexapdf to combine_pdf and qpdf:
https://gist.github.com/gettalong/8955ff5403fe7abb7bee
Not sure how much time, energy and motivation you have, but perhaps if you
feel like it, could this be updated for 2026, with present hexapdf and qpdf?
I suppose it may not have changed that much; though perhaps it has. The
reason I mention it is that I just added hexapdf support to my wrapper over
optimising .pdf files, called PdfOptimizer. In the past I used qpdf primarily.
I tested via hexapdf just now and I was surprised that hexapdf appears to work
better than qpdf with regards to compression (but perhaps I am wrong). So this
is why I am curious, perhaps the net savings depend a lot on the type of .pdf
file (lots of images no images, text, and so forth).
Also there is i-love-pdf website; while the "generate low quality" pdf results
in awful .pdf files, the default seem to be quite useful. Not sure if that
can be easily tested automatically but I am quite curious how they manage
to optimise .pdf files. Would be nice if hexapdf can achieve the same (but
I don't know the differences. The most aggressive optimisation indeed
result in images that are too awful to look at.)
Anyway this is mostly an idea, so I put it into discussion rather than issues.
Beta Was this translation helpful? Give feedback.
All reactions