I've found on some PDFs with large embedded TIFF assets,tiff_depredict gets really slow because of the cost of MRI's array appending operation on the buffer unfiltered. The profiler also shows the MRI's GC cost are also dominant here.
This PR uses string instead of array for buffering. In my particular case, the processing duration improved 15x (from 30 secs to 2 secs).
Hi, thank you for the great gem.
I've found on some PDFs with large embedded TIFF assets,
tiff_depredict
gets really slow because of the cost of MRI's array appending operation on the bufferunfiltered
. The profiler also shows the MRI's GC cost are also dominant here. This PR uses string instead of array for buffering. In my particular case, the processing duration improved 15x (from 30 secs to 2 secs).