[PhotoFloat] [PATCH] Multiprocessing/threading of 'thumbing'
Joachim Tingvold
joachim at tingvold.com
Wed Oct 23 00:25:01 CEST 2013
Hi,
So, having pictures with high resolution it took a while to process
(i.e. 'thumb') images. At least when I had many of them. Eventually I
got tired of all the waiting for 'thumbing' (-:
I'm no Python expert, so I had to fool around some, but eventually got
it working;
<http://git.jocke.no/photofloat/commit/?id=a7f2ca1c0cbd89f6dca5c2523562a6ade7873493>
There are some notes regarding this;
- Interrupt makes the script go stale. I honestly never hit interrupt,
so I haven't bothered looking into it.
- It only does multiprocessing of all Photo.thumb_sizes, which
basically means it only utilizes 5 threads. In other words; going from 8
cores to 16 doesn't improve speed. Anyways, for now this improves the
speed by 5 times (assuming you have at least 5 cores).
- It uses N threads, where N is the number of total cores on the
system, minus one. Hence, people having f.ex. 2 or 4 cores should
probably override this setting if you want to utilize all cores. I did
the 'minus one' to avoid it using all cores (leaving one for other stuff
on your system).
--
Joachim
More information about the PhotoFloat
mailing list