lcorbasson / pdfsizeopt

Automatically exported from code.google.com/p/pdfsizeopt
0 stars 0 forks source link

Parallelizing external tools with lowered priority #69

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
Thanks for this great tool. I think, there are ways to make it even a bit 
better.

My suggestion is, to use as many pngout instances in parallel, as there are CPU 
cores and set their priority slightly below normal to keep the system 
responsive.

On my Windows 7 system with current pdfsizeopt and an old dual core processor, 
optimizing a PDF with more than one lossless graphic leads to the start of a 
single instance of pngout with normal priority. After one image is optimized, 
the pngout-instance closes and another one starts until all images are 
optimized. This way, one of my two CPU cores is always close to 100% all the 
time, while the other one is around 0%.

By using all CPU cores and lowering the priority, the overall time to optimize 
a PDF with lossless graphics might scale allmost lineary with the number of CPU 
cores, while the system might be more responsive when the priority is lowered.

Personal needs
I would like to set the number of parallel processes on my own, depending on 
the machine and the situation. I would also like to be able to set the priority 
for the processes by myself, so that I can do large jobs at background priority 
while in most situations, I would use two threads. One at background priority 
and one at slightly lowered priority, so that I can still work while all my CPU 
power is used.

Original issue reported on code.google.com by Sebastia...@googlemail.com on 13 Aug 2012 at 2:19

GoogleCodeExporter commented 8 years ago
Thank you for this well-explained feature request.

I don't have the motivation and the free time to work on this feature, but I'm 
not against it. I'm happy to accept patches or some cash as motivation.

Original comment by pts...@gmail.com on 28 Aug 2012 at 12:14