glamour perf

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

glamour perf

Usman Bhatti
Hello all,

I sat with Benjamin today to have a look at Glamour performance when displaying large text files. For reminder, when displaying text in glamour, the time to display text increases exponentially with the size of the text being displayed.

Two observations:

1/ Whereas, with the following script the execution time remains equivalent to that of morphs

MessageTally spyOn: [ (GLMPluggableTextMorph
on: [ (StandardFileStream fileNamed: 'testfile-glam-3500.txt') contents ]
text: #value
accept: nil) openInWindow extent:  (1273.0@738.0) ] 

the execution of this script is four times longer:

| browser text|
browser := GLMTabulator new.
browser column: #text.
browser transmit to: #text; andShow: [ :a | 
a text 
title: 'Text with selection';
display: [(StandardFileStream fileNamed: 'testfile-glam-3500.txt') contents]].
MessageTally spyOn: [browser openOn: 2].


2/ A bit of digging (using time profiler) shows that the garbage collector is taking 75% of the execution time. Inline image 1

Doru, will you have an idea what makes garbage collector execute and take extra seconds when the text is displayed in a glamour browser instead of individual glmaour widget?

The moose image with the scripts can be found here if you want to have a look.

thanx in advance,


Usman

_______________________________________________
Moose-dev mailing list
[hidden email]
https://www.iam.unibe.ch/mailman/listinfo/moose-dev
Reply | Threaded
Open this post in threaded view
|

Re: glamour perf

Tudor Girba-2
Hi,

Not really. We would need some spy over the objects that get created to answer that question. I will try to take a look, but I cannot promise anything.

However, I think we can find another solution. Perhaps we could create another presentation that uses a plain TextMorph that is less heavy than the PluggableTextMorph.

Cheers,
Doru



On Thu, Sep 13, 2012 at 6:13 PM, Usman Bhatti <[hidden email]> wrote:
Hello all,

I sat with Benjamin today to have a look at Glamour performance when displaying large text files. For reminder, when displaying text in glamour, the time to display text increases exponentially with the size of the text being displayed.

Two observations:

1/ Whereas, with the following script the execution time remains equivalent to that of morphs

MessageTally spyOn: [ (GLMPluggableTextMorph
on: [ (StandardFileStream fileNamed: 'testfile-glam-3500.txt') contents ]
text: #value
accept: nil) openInWindow extent:  (1273.0@738.0) ] 

the execution of this script is four times longer:

| browser text|
browser := GLMTabulator new.
browser column: #text.
browser transmit to: #text; andShow: [ :a | 
a text 
title: 'Text with selection';
display: [(StandardFileStream fileNamed: 'testfile-glam-3500.txt') contents]].
MessageTally spyOn: [browser openOn: 2].


2/ A bit of digging (using time profiler) shows that the garbage collector is taking 75% of the execution time. Inline image 1

Doru, will you have an idea what makes garbage collector execute and take extra seconds when the text is displayed in a glamour browser instead of individual glmaour widget?

The moose image with the scripts can be found here if you want to have a look.

thanx in advance,


Usman

_______________________________________________
Moose-dev mailing list
[hidden email]
https://www.iam.unibe.ch/mailman/listinfo/moose-dev




--

"Every thing has its own flow"


_______________________________________________
Moose-dev mailing list
[hidden email]
https://www.iam.unibe.ch/mailman/listinfo/moose-dev
Reply | Threaded
Open this post in threaded view
|

Re: glamour perf

Stéphane Ducasse
In reply to this post by Usman Bhatti
usman

this is strange that there is so much trashing of the GC.
Now this is probably not the answer but can you apply the change made by alain to see the difference?
this change short cuts the use of widestrings.

!Paragraph methodsFor: 'composition' stamp: 'AlainPlantec 9/13/2012 23:45'!
composeAll
        ^ self
                composeLinesFrom: firstCharacterIndex
                to: text size
                delta: 0
                into: OrderedCollection new
                priorLines: Array new
                atY: container top! !


stef




On Sep 13, 2012, at 6:13 PM, Usman Bhatti wrote:

> Hello all,
>
> I sat with Benjamin today to have a look at Glamour performance when displaying large text files. For reminder, when displaying text in glamour, the time to display text increases exponentially with the size of the text being displayed.
>
> Two observations:
>
> 1/ Whereas, with the following script the execution time remains equivalent to that of morphs
>
> MessageTally spyOn: [ (GLMPluggableTextMorph
> on: [ (StandardFileStream fileNamed: 'testfile-glam-3500.txt') contents ]
> text: #value
> accept: nil) openInWindow extent:  (1273.0@738.0) ]
>
> the execution of this script is four times longer:
>
> | browser text|
> browser := GLMTabulator new.
> browser column: #text.
> browser transmit to: #text; andShow: [ :a |
> a text
> title: 'Text with selection';
> display: [(StandardFileStream fileNamed: 'testfile-glam-3500.txt') contents]].
> MessageTally spyOn: [browser openOn: 2].
>
>
> 2/ A bit of digging (using time profiler) shows that the garbage collector is taking 75% of the execution time. <image.png>
>
> Doru, will you have an idea what makes garbage collector execute and take extra seconds when the text is displayed in a glamour browser instead of individual glmaour widget?
>
> The moose image with the scripts can be found here if you want to have a look.
> http://dl.dropbox.com/u/11804892/glamour-perf-tests.zip
>
> thanx in advance,
>
>
> Usman
> _______________________________________________
> Moose-dev mailing list
> [hidden email]
> https://www.iam.unibe.ch/mailman/listinfo/moose-dev


_______________________________________________
Moose-dev mailing list
[hidden email]
https://www.iam.unibe.ch/mailman/listinfo/moose-dev