in reply to working with png data

Hello Anonymous Monk,

sorry only sparse hints here: I see you use GD::Simple did you benchmarked your code using directly GD ? Just to be sure simple is not also slower.

You are processing a lot of data: you can use more cores to parse it. MCE offers you MCE::Map that sounds a good choice for your case. MCE::Examples shows code to chunk input data preserving the order. If you are able to rearrange one of the example I bet you get a big speed gain.

Show your progresses, please ;)

L*

There are no rules, there are no thumbs..
Reinvent the wheel, then learn The Wheel; may be one day you reinvent one of THE WHEELS.

Replies are listed 'Best First'.
Re^2: working with png data
by Anonymous Monk on Sep 09, 2019 at 11:21 UTC
    If you dont know where the bottleneck lies.... Throw in threads and hope it speeds up sprintf?
      the time is wasted in :
      $pdata |= ~$png->wbmp($_) foreach (@col);
      the while loop with the sprintf is not the bottleneck. (maybe not optimal, but contribute less)