Creation form from PNG file very slow on Pharo 4 and 5

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
40 messages Options
12
Reply | Threaded
Open this post in threaded view
|

Re: Creation form from PNG file very slow on Pharo 4 and 5

Mariano Martinez Peck
Fuel all the way down :)

On Sun, Jan 17, 2016 at 5:17 PM, Tudor Girba <[hidden email]> wrote:
Hi,

> On Jan 17, 2016, at 8:27 PM, Sven Van Caekenberghe <[hidden email]> wrote:
>
>
>> On 17 Jan 2016, at 19:58, Stephan Eggermont <[hidden email]> wrote:
>>
>> On 16-01-16 13:50, Dimitris Chloupis wrote:
>>> Seems that creating forms and morph from pngs is super slow
>>
>> Put the forms in one fuel file and materialize that
>>
>> Stephan
>
> That is exactly what I showed him in https://pharo.fogbugz.com/f/cases/17403/Creating-Forms-from-PNGs-is-very-slow

That is actually a very cool idea. Thank you both :)

Doru

> The speedup was massive and it was so easy to do.
>
> But the fact remains that the PNG parser itself, being written in pure Pharo, could use a Plugin counterpart, like in the JPG case.
>
> Sven

--
www.tudorgirba.com
www.feenk.com

"Sometimes the best solution is not the best solution."





--
Reply | Threaded
Open this post in threaded view
|

Re: Creation form from PNG file very slow on Pharo 4 and 5

kilon.alios
Fuel is great indeed and very convenient ,will definetly use this approach if I end up dealing with a lot of PNGs and experience some serious delays, but for now, lazy loading with some forking should be enough to make this instantaneous .  I prefer to stick with pngs because it easy to update them and version control them via git and github

On Sun, Jan 17, 2016 at 11:18 PM Mariano Martinez Peck <[hidden email]> wrote:
Fuel all the way down :)

On Sun, Jan 17, 2016 at 5:17 PM, Tudor Girba <[hidden email]> wrote:
Hi,

> On Jan 17, 2016, at 8:27 PM, Sven Van Caekenberghe <[hidden email]> wrote:
>
>
>> On 17 Jan 2016, at 19:58, Stephan Eggermont <[hidden email]> wrote:
>>
>> On 16-01-16 13:50, Dimitris Chloupis wrote:
>>> Seems that creating forms and morph from pngs is super slow
>>
>> Put the forms in one fuel file and materialize that
>>
>> Stephan
>
> That is exactly what I showed him in https://pharo.fogbugz.com/f/cases/17403/Creating-Forms-from-PNGs-is-very-slow

That is actually a very cool idea. Thank you both :)

Doru

> The speedup was massive and it was so easy to do.
>
> But the fact remains that the PNG parser itself, being written in pure Pharo, could use a Plugin counterpart, like in the JPG case.
>
> Sven

--
www.tudorgirba.com
www.feenk.com

"Sometimes the best solution is not the best solution."





Reply | Threaded
Open this post in threaded view
|

Re: Creation form from PNG file very slow on Pharo 4 and 5

Thierry Goubier
Hi Kilon,

Le 17/01/2016 22:25, Dimitris Chloupis a écrit :
> Fuel is great indeed and very convenient ,will definetly use this
> approach if I end up dealing with a lot of PNGs and experience some
> serious delays, but for now, lazy loading with some forking should be
> enough to make this instantaneous .  I prefer to stick with pngs because
> it easy to update them and version control them via git and github

I think there is a way to cache your pngs, their creation time, and load
them only once upon installation of your tool, and update them in memory
only if they have been changed on disk.

I suspect all media heavy software have tactics to work around the same
performance issues: multi-resource formats (zip or fuel) and the same
kind of caching (load only once when installing the software).

Thierry

> On Sun, Jan 17, 2016 at 11:18 PM Mariano Martinez Peck
> <[hidden email] <mailto:[hidden email]>> wrote:
>
>     Fuel all the way down :)
>
>     On Sun, Jan 17, 2016 at 5:17 PM, Tudor Girba <[hidden email]
>     <mailto:[hidden email]>> wrote:
>
>         Hi,
>
>         > On Jan 17, 2016, at 8:27 PM, Sven Van Caekenberghe <[hidden email] <mailto:[hidden email]>> wrote:
>         >
>         >
>         >> On 17 Jan 2016, at 19:58, Stephan Eggermont <[hidden email] <mailto:[hidden email]>> wrote:
>         >>
>         >> On 16-01-16 13:50, Dimitris Chloupis wrote:
>         >>> Seems that creating forms and morph from pngs is super slow
>         >>
>         >> Put the forms in one fuel file and materialize that
>         >>
>         >> Stephan
>         >
>         > That is exactly what I showed him inhttps://pharo.fogbugz.com/f/cases/17403/Creating-Forms-from-PNGs-is-very-slow
>
>         That is actually a very cool idea. Thank you both :)
>
>         Doru
>
>         > The speedup was massive and it was so easy to do.
>         >
>         > But the fact remains that the PNG parser itself, being written in pure Pharo, could use a Plugin counterpart, like in the JPG case.
>         >
>         > Sven
>
>         --
>         www.tudorgirba.com <http://www.tudorgirba.com>
>         www.feenk.com <http://www.feenk.com>
>
>         "Sometimes the best solution is not the best solution."
>
>
>
>
>
>     --
>     Mariano
>     http://marianopeck.wordpress.com
>


Reply | Threaded
Open this post in threaded view
|

Re: Creation form from PNG file very slow on Pharo 4 and 5

Stephan Eggermont-3
On 18-01-16 10:27, Thierry Goubier wrote:

> Hi Kilon,
>
> Le 17/01/2016 22:25, Dimitris Chloupis a écrit :
>> Fuel is great indeed and very convenient ,will definetly use this
>> approach if I end up dealing with a lot of PNGs and experience some
>> serious delays, but for now, lazy loading with some forking should be
>> enough to make this instantaneous .  I prefer to stick with pngs because
>> it easy to update them and version control them via git and github
>
> I think there is a way to cache your pngs, their creation time, and load
> them only once upon installation of your tool, and update them in memory
> only if they have been changed on disk.
>
> I suspect all media heavy software have tactics to work around the same
> performance issues: multi-resource formats (zip or fuel) and the same
> kind of caching (load only once when installing the software).

Yes, and combining multiple resources in one file to increase the
likelihood that they will be on the same track of a disk instead of on
60 different ones. In web software there is the same problem with
multiple images. The browser doesn't give you many threads to download
them in parallel. If you only get two and have to download 60 images
from the other side of the ocean...
https://css-tricks.com/css-sprites/

Stephan


Reply | Threaded
Open this post in threaded view
|

Re: Creation form from PNG file very slow on Pharo 4 and 5

kilon.alios
I am not convinced, the problem is that 80% of my slow down is on the pharo side , the primitive takes 200ms to read the file, 900-1000 ms are taken to convert to Form  so I dont see how making sprites will help me much. I know you want to blame the hardware , but this is clearly a pharo issue.  I have already posted the my profiling results.

Since half of form creation is the seconds indicator I can stream it so it loads one png per second which should make the opening of gui much faster. I will find a way , its not a big deal.

This thread was never about a problem I cant solve , but rather a notice that there is a part of pharo that is highly inefficient.

On Mon, Jan 18, 2016 at 12:12 PM Stephan Eggermont <[hidden email]> wrote:
On 18-01-16 10:27, Thierry Goubier wrote:
> Hi Kilon,
>
> Le 17/01/2016 22:25, Dimitris Chloupis a écrit :
>> Fuel is great indeed and very convenient ,will definetly use this
>> approach if I end up dealing with a lot of PNGs and experience some
>> serious delays, but for now, lazy loading with some forking should be
>> enough to make this instantaneous .  I prefer to stick with pngs because
>> it easy to update them and version control them via git and github
>
> I think there is a way to cache your pngs, their creation time, and load
> them only once upon installation of your tool, and update them in memory
> only if they have been changed on disk.
>
> I suspect all media heavy software have tactics to work around the same
> performance issues: multi-resource formats (zip or fuel) and the same
> kind of caching (load only once when installing the software).

Yes, and combining multiple resources in one file to increase the
likelihood that they will be on the same track of a disk instead of on
60 different ones. In web software there is the same problem with
multiple images. The browser doesn't give you many threads to download
them in parallel. If you only get two and have to download 60 images
from the other side of the ocean...
https://css-tricks.com/css-sprites/

Stephan


Reply | Threaded
Open this post in threaded view
|

Re: Creation form from PNG file very slow on Pharo 4 and 5

HilaireFernandes
In reply to this post by Stephan Eggermont-3
Fuel is very easy to use and pretty fast. Sadly from one image to
another you have to migrate your fuel data.

An alternative will be to use an Sqlite database, it comes with a bonus:
the format is stable. No idea about speed however.

Hilaire



Le 17/01/2016 19:58, Stephan Eggermont a écrit :
> Put the forms in one fuel file and materialize that

--
Dr. Geo
http://drgeo.eu


Reply | Threaded
Open this post in threaded view
|

Re: Creation form from PNG file very slow on Pharo 4 and 5

Esteban A. Maringolo
If you use that many images and require all of them at once, maybe
spriting them is an option. That's the first recommendation using a
gaming-based approach.

Regards,
Esteban A. Maringolo


2016-01-18 11:27 GMT-03:00 Hilaire <[hidden email]>:

> Fuel is very easy to use and pretty fast. Sadly from one image to
> another you have to migrate your fuel data.
>
> An alternative will be to use an Sqlite database, it comes with a bonus:
> the format is stable. No idea about speed however.
>
> Hilaire
>
>
>
> Le 17/01/2016 19:58, Stephan Eggermont a écrit :
>> Put the forms in one fuel file and materialize that
>
> --
> Dr. Geo
> http://drgeo.eu
>
>

Reply | Threaded
Open this post in threaded view
|

Re: Creation form from PNG file very slow on Pharo 4 and 5

stepharo
In reply to this post by Tudor Girba-2
Pay attention the JPEG reader is getting old and does not support latest
version.

Stef

Le 17/1/16 21:17, Tudor Girba a écrit :

> Hi,
>
>> On Jan 17, 2016, at 8:27 PM, Sven Van Caekenberghe <[hidden email]> wrote:
>>
>>
>>> On 17 Jan 2016, at 19:58, Stephan Eggermont <[hidden email]> wrote:
>>>
>>> On 16-01-16 13:50, Dimitris Chloupis wrote:
>>>> Seems that creating forms and morph from pngs is super slow
>>> Put the forms in one fuel file and materialize that
>>>
>>> Stephan
>> That is exactly what I showed him in https://pharo.fogbugz.com/f/cases/17403/Creating-Forms-from-PNGs-is-very-slow
> That is actually a very cool idea. Thank you both :)
>
> Doru
>
>> The speedup was massive and it was so easy to do.
>>
>> But the fact remains that the PNG parser itself, being written in pure Pharo, could use a Plugin counterpart, like in the JPG case.
>>
>> Sven
> --
> www.tudorgirba.com
> www.feenk.com
>
> "Sometimes the best solution is not the best solution."
>
>
>


Reply | Threaded
Open this post in threaded view
|

Re: Creation form from PNG file very slow on Pharo 4 and 5

HilaireFernandes
In reply to this post by Esteban A. Maringolo
I meant the problem occurs when you migrate the base application to one
version of Pharo to another one, the fuel file need to be upgraded.

Now in the situation of Dimitris this should not be a problem as its
application build script could initialize the newer fuel bitmap file. As
long as there is not user defined fuel files it should be ok.

Hilaire

--
Dr. Geo
http://drgeo.eu


Reply | Threaded
Open this post in threaded view
|

Re: Creation form from PNG file very slow on Pharo 4 and 5

Denis Kudriashov
Interesting what is faster: reading Form from fuel file or reading it from simple BMP file?

2016-01-19 10:31 GMT+01:00 Hilaire <[hidden email]>:
I meant the problem occurs when you migrate the base application to one
version of Pharo to another one, the fuel file need to be upgraded.

Now in the situation of Dimitris this should not be a problem as its
application build script could initialize the newer fuel bitmap file. As
long as there is not user defined fuel files it should be ok.

Hilaire

--
Dr. Geo
http://drgeo.eu



Reply | Threaded
Open this post in threaded view
|

Re: Creation form from PNG file very slow on Pharo 4 and 5

kilon.alios
most likely fuel, since it stores your live object as is.

I like fuel but the fact that I may be limited by incompatible versions is a game stopper for me. I am ok with new version between incompatible with old one but there must be some backward compatibility to any format I use. Or else I end up worrying about things I should not be worrying about.

On Tue, Jan 19, 2016 at 12:23 PM Denis Kudriashov <[hidden email]> wrote:
Interesting what is faster: reading Form from fuel file or reading it from simple BMP file?

2016-01-19 10:31 GMT+01:00 Hilaire <[hidden email]>:
I meant the problem occurs when you migrate the base application to one
version of Pharo to another one, the fuel file need to be upgraded.

Now in the situation of Dimitris this should not be a problem as its
application build script could initialize the newer fuel bitmap file. As
long as there is not user defined fuel files it should be ok.

Hilaire

--
Dr. Geo
http://drgeo.eu



Reply | Threaded
Open this post in threaded view
|

Re: Creation form from PNG file very slow on Pharo 4 and 5

Denis Kudriashov

2016-01-19 11:34 GMT+01:00 Dimitris Chloupis <[hidden email]>:
most likely fuel, since it stores your live object as is.

I like fuel but the fact that I may be limited by incompatible versions is a game stopper for me. I am ok with new version between incompatible with old one but there must be some backward compatibility to any format I use. Or else I end up worrying about things I should not be worrying about.

You are right. I perform little experiment. Fuel reading is 60% faster than BMP:

Smalltalk garbageCollect; garbageCollect.
r1 := [FileLocator imageDirectory / 'test.bmp' readStreamDo: [ :s | 
s binary.
fromBMP := BMPReadWriter formFromStream: s]] benchFor: 2 seconds.

Smalltalk garbageCollect; garbageCollect.
r2:=[FileLocator imageDirectory / 'test.fuel' readStreamDo: [ :s |
s binary.
fromFuel := (FLMaterializer newDefault materializeFrom: s) root]] benchFor: 2 seconds.

{ r1. r2 } "an Array(a BenchmarkResult(2,199 iterations in 2 seconds 2 milliseconds. 1,098 per second) a BenchmarkResult(5,728 iterations in 2 seconds 3 milliseconds. 2,860 per second))"
Reply | Threaded
Open this post in threaded view
|

Re: Creation form from PNG file very slow on Pharo 4 and 5

Peter Kenny

Denis

 

Very interesting. It would be more interesting if you could save your test image as a .png file, and then include reading with PNGReadWriter in your comparison. This would help to confirm or refute the original point made by Dimitris, that reading from .png is particularly slow.

 

Peter Kenny

 

From: Pharo-users [mailto:[hidden email]] On Behalf Of Denis Kudriashov
Sent: 19 January 2016 10:59
To: Any question about pharo is welcome <[hidden email]>
Subject: Re: [Pharo-users] Creation form from PNG file very slow on Pharo 4 and 5

 

 

2016-01-19 11:34 GMT+01:00 Dimitris Chloupis <[hidden email]>:

most likely fuel, since it stores your live object as is.

I like fuel but the fact that I may be limited by incompatible versions is a game stopper for me. I am ok with new version between incompatible with old one but there must be some backward compatibility to any format I use. Or else I end up worrying about things I should not be worrying about.


You are right. I perform little experiment. Fuel reading is 60% faster than BMP:

 

Smalltalk garbageCollect; garbageCollect.

r1 := [FileLocator imageDirectory / 'test.bmp' readStreamDo: [ :s | 

            s binary.

fromBMP := BMPReadWriter formFromStream: s]] benchFor: 2 seconds.

 

Smalltalk garbageCollect; garbageCollect.

r2:=[FileLocator imageDirectory / 'test.fuel' readStreamDo: [ :s |

            s binary.

fromFuel := (FLMaterializer newDefault materializeFrom: s) root]] benchFor: 2 seconds.

 

{ r1. r2 } "an Array(a BenchmarkResult(2,199 iterations in 2 seconds 2 milliseconds. 1,098 per second) a BenchmarkResult(5,728 iterations in 2 seconds 3 milliseconds. 2,860 per second))"

Reply | Threaded
Open this post in threaded view
|

Re: Creation form from PNG file very slow on Pharo 4 and 5

Sven Van Caekenberghe-2

> On 19 Jan 2016, at 12:29, PBKResearch <[hidden email]> wrote:
>
> Denis
>  
> Very interesting. It would be more interesting if you could save your test image as a .png file, and then include reading with PNGReadWriter in your comparison. This would help to confirm or refute the original point made by Dimitris, that reading from .png is particularly slow.

Check the original thread/case, it is slow. Not *very* slow, but slower than the plugin based JPEG reader. That is what we eventually need, a plugin base PNG reader.

> Peter Kenny
>  
> From: Pharo-users [mailto:[hidden email]] On Behalf Of Denis Kudriashov
> Sent: 19 January 2016 10:59
> To: Any question about pharo is welcome <[hidden email]>
> Subject: Re: [Pharo-users] Creation form from PNG file very slow on Pharo 4 and 5
>  
>  
> 2016-01-19 11:34 GMT+01:00 Dimitris Chloupis <[hidden email]>:
>> most likely fuel, since it stores your live object as is.
>>
>> I like fuel but the fact that I may be limited by incompatible versions is a game stopper for me. I am ok with new version between incompatible with old one but there must be some backward compatibility to any format I use. Or else I end up worrying about things I should not be worrying about.
>
> You are right. I perform little experiment. Fuel reading is 60% faster than BMP:
>  
> Smalltalk garbageCollect; garbageCollect.
> r1 := [FileLocator imageDirectory / 'test.bmp' readStreamDo: [ :s |
>             s binary.
> fromBMP := BMPReadWriter formFromStream: s]] benchFor: 2 seconds.
>  
> Smalltalk garbageCollect; garbageCollect.
> r2:=[FileLocator imageDirectory / 'test.fuel' readStreamDo: [ :s |
>             s binary.
> fromFuel := (FLMaterializer newDefault materializeFrom: s) root]] benchFor: 2 seconds.
>  
> { r1. r2 } "an Array(a BenchmarkResult(2,199 iterations in 2 seconds 2 milliseconds. 1,098 per second) a BenchmarkResult(5,728 iterations in 2 seconds 3 milliseconds. 2,860 per second))"


Reply | Threaded
Open this post in threaded view
|

Re: Creation form from PNG file very slow on Pharo 4 and 5

EstebanLM
Yesterday I tested creating PNGs from disk using Athens:

[(AthensCairoSurface
        createFromFile: '/Users/esteban/Dev/Pharo/pharo50/Lenna.png'
        ifFailed: [ ])
        asForm] bench.

That gave me 46k/s … (455k image) which IMO is pretty reasonable :)

Esteban

> On 19 Jan 2016, at 12:34, Sven Van Caekenberghe <[hidden email]> wrote:
>
>
>> On 19 Jan 2016, at 12:29, PBKResearch <[hidden email]> wrote:
>>
>> Denis
>>
>> Very interesting. It would be more interesting if you could save your test image as a .png file, and then include reading with PNGReadWriter in your comparison. This would help to confirm or refute the original point made by Dimitris, that reading from .png is particularly slow.
>
> Check the original thread/case, it is slow. Not *very* slow, but slower than the plugin based JPEG reader. That is what we eventually need, a plugin base PNG reader.
>
>> Peter Kenny
>>
>> From: Pharo-users [mailto:[hidden email]] On Behalf Of Denis Kudriashov
>> Sent: 19 January 2016 10:59
>> To: Any question about pharo is welcome <[hidden email]>
>> Subject: Re: [Pharo-users] Creation form from PNG file very slow on Pharo 4 and 5
>>
>>
>> 2016-01-19 11:34 GMT+01:00 Dimitris Chloupis <[hidden email]>:
>>> most likely fuel, since it stores your live object as is.
>>>
>>> I like fuel but the fact that I may be limited by incompatible versions is a game stopper for me. I am ok with new version between incompatible with old one but there must be some backward compatibility to any format I use. Or else I end up worrying about things I should not be worrying about.
>>
>> You are right. I perform little experiment. Fuel reading is 60% faster than BMP:
>>
>> Smalltalk garbageCollect; garbageCollect.
>> r1 := [FileLocator imageDirectory / 'test.bmp' readStreamDo: [ :s |
>>            s binary.
>> fromBMP := BMPReadWriter formFromStream: s]] benchFor: 2 seconds.
>>
>> Smalltalk garbageCollect; garbageCollect.
>> r2:=[FileLocator imageDirectory / 'test.fuel' readStreamDo: [ :s |
>>            s binary.
>> fromFuel := (FLMaterializer newDefault materializeFrom: s) root]] benchFor: 2 seconds.
>>
>> { r1. r2 } "an Array(a BenchmarkResult(2,199 iterations in 2 seconds 2 milliseconds. 1,098 per second) a BenchmarkResult(5,728 iterations in 2 seconds 3 milliseconds. 2,860 per second))"
>
>


Reply | Threaded
Open this post in threaded view
|

Re: Creation form from PNG file very slow on Pharo 4 and 5

Denis Kudriashov
And more extended test:

Smalltalk garbageCollect; garbageCollect.
r1:=[FileLocator imageDirectory / 'test.fuel' readStreamDo: [ :s |
s binary.
fromFuel := (FLMaterializer newDefault materializeFrom: s) root]] benchFor: 2 seconds.

Smalltalk garbageCollect; garbageCollect.
r2 := [FileLocator imageDirectory / 'test.bmp' readStreamDo: [ :s | 
s binary.
fromBMP := BMPReadWriter new on: s; nextImage]] benchFor: 2 seconds.

Smalltalk garbageCollect; garbageCollect.
r3 := [FileLocator imageDirectory / 'test.png' readStreamDo: [ :s | 
s binary.
fromPNG := PNGReadWriter new on: s; nextImage]] benchFor: 2 seconds.

Smalltalk garbageCollect; garbageCollect.
r4:= [
fromAthens := (AthensCairoSurface
        createFromFile: (FileLocator imageDirectory / 'test.png') pathString
        ifFailed: []) asForm.
] benchFor: 2 seconds.


{ r1. r2. r3. r4 }.
 "an Array(a BenchmarkResult(5,537 iterations in 2 seconds 2 milliseconds. 2,766 per second) a BenchmarkResult(2,193 iterations in 2 seconds 2 milliseconds. 1,095 per second) a BenchmarkResult(443 iterations in 2 seconds 5 milliseconds. 220.948 per second) a BenchmarkResult(1,033 iterations in 2 seconds 3 milliseconds. 515.726 per second))"


2016-01-19 13:21 GMT+01:00 Esteban Lorenzano <[hidden email]>:
Yesterday I tested creating PNGs from disk using Athens:

[(AthensCairoSurface
        createFromFile: '/Users/esteban/Dev/Pharo/pharo50/Lenna.png'
        ifFailed: [ ])
        asForm] bench.

That gave me 46k/s … (455k image) which IMO is pretty reasonable :)

Esteban

> On 19 Jan 2016, at 12:34, Sven Van Caekenberghe <[hidden email]> wrote:
>
>
>> On 19 Jan 2016, at 12:29, PBKResearch <[hidden email]> wrote:
>>
>> Denis
>>
>> Very interesting. It would be more interesting if you could save your test image as a .png file, and then include reading with PNGReadWriter in your comparison. This would help to confirm or refute the original point made by Dimitris, that reading from .png is particularly slow.
>
> Check the original thread/case, it is slow. Not *very* slow, but slower than the plugin based JPEG reader. That is what we eventually need, a plugin base PNG reader.
>
>> Peter Kenny
>>
>> From: Pharo-users [mailto:[hidden email]] On Behalf Of Denis Kudriashov
>> Sent: 19 January 2016 10:59
>> To: Any question about pharo is welcome <[hidden email]>
>> Subject: Re: [Pharo-users] Creation form from PNG file very slow on Pharo 4 and 5
>>
>>
>> 2016-01-19 11:34 GMT+01:00 Dimitris Chloupis <[hidden email]>:
>>> most likely fuel, since it stores your live object as is.
>>>
>>> I like fuel but the fact that I may be limited by incompatible versions is a game stopper for me. I am ok with new version between incompatible with old one but there must be some backward compatibility to any format I use. Or else I end up worrying about things I should not be worrying about.
>>
>> You are right. I perform little experiment. Fuel reading is 60% faster than BMP:
>>
>> Smalltalk garbageCollect; garbageCollect.
>> r1 := [FileLocator imageDirectory / 'test.bmp' readStreamDo: [ :s |
>>            s binary.
>> fromBMP := BMPReadWriter formFromStream: s]] benchFor: 2 seconds.
>>
>> Smalltalk garbageCollect; garbageCollect.
>> r2:=[FileLocator imageDirectory / 'test.fuel' readStreamDo: [ :s |
>>            s binary.
>> fromFuel := (FLMaterializer newDefault materializeFrom: s) root]] benchFor: 2 seconds.
>>
>> { r1. r2 } "an Array(a BenchmarkResult(2,199 iterations in 2 seconds 2 milliseconds. 1,098 per second) a BenchmarkResult(5,728 iterations in 2 seconds 3 milliseconds. 2,860 per second))"
>
>




test.png (20K) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: Creation form from PNG file very slow on Pharo 4 and 5

kilon.alios
In reply to this post by EstebanLM
does not work for me on ubuntu it keeps saying that "cannot locate cairo library" even though its installed via

sudo apt-get install libcairo2-dev

By the way just for the fun, I will make a benchmark comparison betweem PNG loader in pharo and SDL in C to see what is the speed difference and dust off my C skills.

On Tue, Jan 19, 2016 at 2:22 PM Esteban Lorenzano <[hidden email]> wrote:
Yesterday I tested creating PNGs from disk using Athens:

[(AthensCairoSurface
        createFromFile: '/Users/esteban/Dev/Pharo/pharo50/Lenna.png'
        ifFailed: [ ])
        asForm] bench.

That gave me 46k/s … (455k image) which IMO is pretty reasonable :)

Esteban

> On 19 Jan 2016, at 12:34, Sven Van Caekenberghe <[hidden email]> wrote:
>
>
>> On 19 Jan 2016, at 12:29, PBKResearch <[hidden email]> wrote:
>>
>> Denis
>>
>> Very interesting. It would be more interesting if you could save your test image as a .png file, and then include reading with PNGReadWriter in your comparison. This would help to confirm or refute the original point made by Dimitris, that reading from .png is particularly slow.
>
> Check the original thread/case, it is slow. Not *very* slow, but slower than the plugin based JPEG reader. That is what we eventually need, a plugin base PNG reader.
>
>> Peter Kenny
>>
>> From: Pharo-users [mailto:[hidden email]] On Behalf Of Denis Kudriashov
>> Sent: 19 January 2016 10:59
>> To: Any question about pharo is welcome <[hidden email]>
>> Subject: Re: [Pharo-users] Creation form from PNG file very slow on Pharo 4 and 5
>>
>>
>> 2016-01-19 11:34 GMT+01:00 Dimitris Chloupis <[hidden email]>:
>>> most likely fuel, since it stores your live object as is.
>>>
>>> I like fuel but the fact that I may be limited by incompatible versions is a game stopper for me. I am ok with new version between incompatible with old one but there must be some backward compatibility to any format I use. Or else I end up worrying about things I should not be worrying about.
>>
>> You are right. I perform little experiment. Fuel reading is 60% faster than BMP:
>>
>> Smalltalk garbageCollect; garbageCollect.
>> r1 := [FileLocator imageDirectory / 'test.bmp' readStreamDo: [ :s |
>>            s binary.
>> fromBMP := BMPReadWriter formFromStream: s]] benchFor: 2 seconds.
>>
>> Smalltalk garbageCollect; garbageCollect.
>> r2:=[FileLocator imageDirectory / 'test.fuel' readStreamDo: [ :s |
>>            s binary.
>> fromFuel := (FLMaterializer newDefault materializeFrom: s) root]] benchFor: 2 seconds.
>>
>> { r1. r2 } "an Array(a BenchmarkResult(2,199 iterations in 2 seconds 2 milliseconds. 1,098 per second) a BenchmarkResult(5,728 iterations in 2 seconds 3 milliseconds. 2,860 per second))"
>
>


Reply | Threaded
Open this post in threaded view
|

Re: Creation form from PNG file very slow on Pharo 4 and 5

kilon.alios
ah yes it needs the 32 bit libs of cairo, yeah good luck with that, cant wait till we finally support 64 bit, but far my most needed feature of pharo. No idea how to find 32 bit lib of cairo, google returns nothing meaningful, download page of cairo website mentions nothing.

On Tue, Jan 19, 2016 at 2:52 PM Dimitris Chloupis <[hidden email]> wrote:
does not work for me on ubuntu it keeps saying that "cannot locate cairo library" even though its installed via

sudo apt-get install libcairo2-dev

By the way just for the fun, I will make a benchmark comparison betweem PNG loader in pharo and SDL in C to see what is the speed difference and dust off my C skills.

On Tue, Jan 19, 2016 at 2:22 PM Esteban Lorenzano <[hidden email]> wrote:
Yesterday I tested creating PNGs from disk using Athens:

[(AthensCairoSurface
        createFromFile: '/Users/esteban/Dev/Pharo/pharo50/Lenna.png'
        ifFailed: [ ])
        asForm] bench.

That gave me 46k/s … (455k image) which IMO is pretty reasonable :)

Esteban

> On 19 Jan 2016, at 12:34, Sven Van Caekenberghe <[hidden email]> wrote:
>
>
>> On 19 Jan 2016, at 12:29, PBKResearch <[hidden email]> wrote:
>>
>> Denis
>>
>> Very interesting. It would be more interesting if you could save your test image as a .png file, and then include reading with PNGReadWriter in your comparison. This would help to confirm or refute the original point made by Dimitris, that reading from .png is particularly slow.
>
> Check the original thread/case, it is slow. Not *very* slow, but slower than the plugin based JPEG reader. That is what we eventually need, a plugin base PNG reader.
>
>> Peter Kenny
>>
>> From: Pharo-users [mailto:[hidden email]] On Behalf Of Denis Kudriashov
>> Sent: 19 January 2016 10:59
>> To: Any question about pharo is welcome <[hidden email]>
>> Subject: Re: [Pharo-users] Creation form from PNG file very slow on Pharo 4 and 5
>>
>>
>> 2016-01-19 11:34 GMT+01:00 Dimitris Chloupis <[hidden email]>:
>>> most likely fuel, since it stores your live object as is.
>>>
>>> I like fuel but the fact that I may be limited by incompatible versions is a game stopper for me. I am ok with new version between incompatible with old one but there must be some backward compatibility to any format I use. Or else I end up worrying about things I should not be worrying about.
>>
>> You are right. I perform little experiment. Fuel reading is 60% faster than BMP:
>>
>> Smalltalk garbageCollect; garbageCollect.
>> r1 := [FileLocator imageDirectory / 'test.bmp' readStreamDo: [ :s |
>>            s binary.
>> fromBMP := BMPReadWriter formFromStream: s]] benchFor: 2 seconds.
>>
>> Smalltalk garbageCollect; garbageCollect.
>> r2:=[FileLocator imageDirectory / 'test.fuel' readStreamDo: [ :s |
>>            s binary.
>> fromFuel := (FLMaterializer newDefault materializeFrom: s) root]] benchFor: 2 seconds.
>>
>> { r1. r2 } "an Array(a BenchmarkResult(2,199 iterations in 2 seconds 2 milliseconds. 1,098 per second) a BenchmarkResult(5,728 iterations in 2 seconds 3 milliseconds. 2,860 per second))"
>
>


Reply | Threaded
Open this post in threaded view
|

Re: Creation form from PNG file very slow on Pharo 4 and 5

Ben Coman
$ apt-cache search cairo | grep cairo | less
shows... libcairo2 - Cairo 2D vector graphics library

so following the pattern for Debian here...
http://pharo.org/gnu-linux-installation

I presume...
$ sudo dpkg --add-architecture i386
$ sudo apt-get update
$ sudo apt-get install  libcairo2:i386

...but haven't tried this since I'm using 32-bit Debian.

cheers -ben

On Tue, Jan 19, 2016 at 9:02 PM, Dimitris Chloupis
<[hidden email]> wrote:

> ah yes it needs the 32 bit libs of cairo, yeah good luck with that, cant
> wait till we finally support 64 bit, but far my most needed feature of
> pharo. No idea how to find 32 bit lib of cairo, google returns nothing
> meaningful, download page of cairo website mentions nothing.
>
> On Tue, Jan 19, 2016 at 2:52 PM Dimitris Chloupis <[hidden email]>
> wrote:
>>
>> does not work for me on ubuntu it keeps saying that "cannot locate cairo
>> library" even though its installed via
>>
>> sudo apt-get install libcairo2-dev
>>
>> By the way just for the fun, I will make a benchmark comparison betweem
>> PNG loader in pharo and SDL in C to see what is the speed difference and
>> dust off my C skills.
>>
>> On Tue, Jan 19, 2016 at 2:22 PM Esteban Lorenzano <[hidden email]>
>> wrote:
>>>
>>> Yesterday I tested creating PNGs from disk using Athens:
>>>
>>> [(AthensCairoSurface
>>>         createFromFile: '/Users/esteban/Dev/Pharo/pharo50/Lenna.png'
>>>         ifFailed: [ ])
>>>         asForm] bench.
>>>
>>> That gave me 46k/s … (455k image) which IMO is pretty reasonable :)
>>>
>>> Esteban
>>>
>>> > On 19 Jan 2016, at 12:34, Sven Van Caekenberghe <[hidden email]> wrote:
>>> >
>>> >
>>> >> On 19 Jan 2016, at 12:29, PBKResearch <[hidden email]> wrote:
>>> >>
>>> >> Denis
>>> >>
>>> >> Very interesting. It would be more interesting if you could save your
>>> >> test image as a .png file, and then include reading with PNGReadWriter in
>>> >> your comparison. This would help to confirm or refute the original point
>>> >> made by Dimitris, that reading from .png is particularly slow.
>>> >
>>> > Check the original thread/case, it is slow. Not *very* slow, but slower
>>> > than the plugin based JPEG reader. That is what we eventually need, a plugin
>>> > base PNG reader.
>>> >
>>> >> Peter Kenny
>>> >>
>>> >> From: Pharo-users [mailto:[hidden email]] On
>>> >> Behalf Of Denis Kudriashov
>>> >> Sent: 19 January 2016 10:59
>>> >> To: Any question about pharo is welcome <[hidden email]>
>>> >> Subject: Re: [Pharo-users] Creation form from PNG file very slow on
>>> >> Pharo 4 and 5
>>> >>
>>> >>
>>> >> 2016-01-19 11:34 GMT+01:00 Dimitris Chloupis <[hidden email]>:
>>> >>> most likely fuel, since it stores your live object as is.
>>> >>>
>>> >>> I like fuel but the fact that I may be limited by incompatible
>>> >>> versions is a game stopper for me. I am ok with new version between
>>> >>> incompatible with old one but there must be some backward compatibility to
>>> >>> any format I use. Or else I end up worrying about things I should not be
>>> >>> worrying about.
>>> >>
>>> >> You are right. I perform little experiment. Fuel reading is 60% faster
>>> >> than BMP:
>>> >>
>>> >> Smalltalk garbageCollect; garbageCollect.
>>> >> r1 := [FileLocator imageDirectory / 'test.bmp' readStreamDo: [ :s |
>>> >>            s binary.
>>> >> fromBMP := BMPReadWriter formFromStream: s]] benchFor: 2 seconds.
>>> >>
>>> >> Smalltalk garbageCollect; garbageCollect.
>>> >> r2:=[FileLocator imageDirectory / 'test.fuel' readStreamDo: [ :s |
>>> >>            s binary.
>>> >> fromFuel := (FLMaterializer newDefault materializeFrom: s) root]]
>>> >> benchFor: 2 seconds.
>>> >>
>>> >> { r1. r2 } "an Array(a BenchmarkResult(2,199 iterations in 2 seconds 2
>>> >> milliseconds. 1,098 per second) a BenchmarkResult(5,728 iterations in 2
>>> >> seconds 3 milliseconds. 2,860 per second))"
>>> >
>>> >
>>>
>>>
>

Reply | Threaded
Open this post in threaded view
|

Re: Creation form from PNG file very slow on Pharo 4 and 5

kilon.alios
thanks ben that indeed get the cairo 32 bit version but there must be a version mismatch because now pharo complains
"Error:Could not  find accessor for variable named "aCairoSurfaceHandle" "

On Tue, Jan 19, 2016 at 3:30 PM Ben Coman <[hidden email]> wrote:
$ apt-cache search cairo | grep cairo | less
shows... libcairo2 - Cairo 2D vector graphics library

so following the pattern for Debian here...
http://pharo.org/gnu-linux-installation

I presume...
$ sudo dpkg --add-architecture i386
$ sudo apt-get update
$ sudo apt-get install  libcairo2:i386

...but haven't tried this since I'm using 32-bit Debian.

cheers -ben

On Tue, Jan 19, 2016 at 9:02 PM, Dimitris Chloupis
<[hidden email]> wrote:
> ah yes it needs the 32 bit libs of cairo, yeah good luck with that, cant
> wait till we finally support 64 bit, but far my most needed feature of
> pharo. No idea how to find 32 bit lib of cairo, google returns nothing
> meaningful, download page of cairo website mentions nothing.
>
> On Tue, Jan 19, 2016 at 2:52 PM Dimitris Chloupis <[hidden email]>
> wrote:
>>
>> does not work for me on ubuntu it keeps saying that "cannot locate cairo
>> library" even though its installed via
>>
>> sudo apt-get install libcairo2-dev
>>
>> By the way just for the fun, I will make a benchmark comparison betweem
>> PNG loader in pharo and SDL in C to see what is the speed difference and
>> dust off my C skills.
>>
>> On Tue, Jan 19, 2016 at 2:22 PM Esteban Lorenzano <[hidden email]>
>> wrote:
>>>
>>> Yesterday I tested creating PNGs from disk using Athens:
>>>
>>> [(AthensCairoSurface
>>>         createFromFile: '/Users/esteban/Dev/Pharo/pharo50/Lenna.png'
>>>         ifFailed: [ ])
>>>         asForm] bench.
>>>
>>> That gave me 46k/s … (455k image) which IMO is pretty reasonable :)
>>>
>>> Esteban
>>>
>>> > On 19 Jan 2016, at 12:34, Sven Van Caekenberghe <[hidden email]> wrote:
>>> >
>>> >
>>> >> On 19 Jan 2016, at 12:29, PBKResearch <[hidden email]> wrote:
>>> >>
>>> >> Denis
>>> >>
>>> >> Very interesting. It would be more interesting if you could save your
>>> >> test image as a .png file, and then include reading with PNGReadWriter in
>>> >> your comparison. This would help to confirm or refute the original point
>>> >> made by Dimitris, that reading from .png is particularly slow.
>>> >
>>> > Check the original thread/case, it is slow. Not *very* slow, but slower
>>> > than the plugin based JPEG reader. That is what we eventually need, a plugin
>>> > base PNG reader.
>>> >
>>> >> Peter Kenny
>>> >>
>>> >> From: Pharo-users [mailto:[hidden email]] On
>>> >> Behalf Of Denis Kudriashov
>>> >> Sent: 19 January 2016 10:59
>>> >> To: Any question about pharo is welcome <[hidden email]>
>>> >> Subject: Re: [Pharo-users] Creation form from PNG file very slow on
>>> >> Pharo 4 and 5
>>> >>
>>> >>
>>> >> 2016-01-19 11:34 GMT+01:00 Dimitris Chloupis <[hidden email]>:
>>> >>> most likely fuel, since it stores your live object as is.
>>> >>>
>>> >>> I like fuel but the fact that I may be limited by incompatible
>>> >>> versions is a game stopper for me. I am ok with new version between
>>> >>> incompatible with old one but there must be some backward compatibility to
>>> >>> any format I use. Or else I end up worrying about things I should not be
>>> >>> worrying about.
>>> >>
>>> >> You are right. I perform little experiment. Fuel reading is 60% faster
>>> >> than BMP:
>>> >>
>>> >> Smalltalk garbageCollect; garbageCollect.
>>> >> r1 := [FileLocator imageDirectory / 'test.bmp' readStreamDo: [ :s |
>>> >>            s binary.
>>> >> fromBMP := BMPReadWriter formFromStream: s]] benchFor: 2 seconds.
>>> >>
>>> >> Smalltalk garbageCollect; garbageCollect.
>>> >> r2:=[FileLocator imageDirectory / 'test.fuel' readStreamDo: [ :s |
>>> >>            s binary.
>>> >> fromFuel := (FLMaterializer newDefault materializeFrom: s) root]]
>>> >> benchFor: 2 seconds.
>>> >>
>>> >> { r1. r2 } "an Array(a BenchmarkResult(2,199 iterations in 2 seconds 2
>>> >> milliseconds. 1,098 per second) a BenchmarkResult(5,728 iterations in 2
>>> >> seconds 3 milliseconds. 2,860 per second))"
>>> >
>>> >
>>>
>>>
>

12