[Newbies] Reading PNG images into squeak image is slow
leves at elte.hu
Fri Oct 25 15:26:04 UTC 2013
Thanks. I found a really bad bottleneck, and fixed some others in
PNGReadWriter. I have uploaded my changes to the Trunk, you can find them
Loading any of the png images you've sent takes 1-1.5 seconds on my
machine with the new version. They took 4-7.5 seconds with the old, so
the speedup is about 4-5x, which might not be enough for you.
You could achieve another 2.5x speedup if your images were in RGBA format
(they are in RGB now), because that way the scanline can be converted
to a Form without byte level manipulations.
On Fri, 25 Oct 2013, Mateusz Grotek wrote:
>> I just realized that it's one minute and nine seconds runtime for you.
>> That's way more than what it should be. Reading an 1920x1004
>> non-interlaced RGBA png image takes less than 200 milliseconds for me
>> using Cog.
>> Can you share the png image, so we can test it?
> After you said that it's not normal behaviour I tried to reproduce it today.
> 1. I cannot reproduce those 1 minute delays.
> 2. I've downloaded fresh Cog
> and Squeak (http://ftp.squeak.org/4.4/Squeak-4.4-All-in-One.zip)
> 3. I've got the following delays in one of my images with the fresh Cog:
> 3. I've got the following delays in the fresh Cog and the fresh Squeak
> 4. Still it's around 15 seconds. Image dependence is interesting because
> they seem to be the same versions (latest update: #12327).
> uname -a
> Linux mglap 126.96.36.199-3.2-pae #1 SMP Wed May 20 03:21:35 CEST 2009 i686
> i686 i386 GNU/Linux
> cat /proc/cpuinfo
> model name : Genuine Intel(R) CPU T1600 @ 1.66GHz
> cpu MHz : 1662.478
> cache size : 1024 KB
> bogomips : 3324.95
> And here are some photos:
> And here is the application I use to read them in:
> a) Create an empty directory
> b) Unpack all.zip to it
> c) Filein Anotator.st
> d) Run it: Anotator new start.
> e) Open transcript
> e) Choose the directory with photos
> f) Klik lewo (left) and prawo (right) to move from one image to another
> (it will create some .txt files while doing it, so it may ask you if you
> want to overwrite)
> g) see the numbers in Transcript
> If you don't want to run the whole app, just run:
> [PNGReadWriter formFromFileNamed: '/some/path'] durationToRun
> Beginners mailing list
> Beginners at lists.squeakfoundation.org
More information about the Beginners