discuss-gnustep
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Performance patch for large texts


From: Frederic
Subject: Re: Performance patch for large texts
Date: Mon, 21 May 2001 23:36:21 -0400

Fred Kiefer a écrit :
> 
> Frederic wrote:
> > But I also met some performance issues:
> > 1. Open takes 59sec on my machine (Linux 2.4 Pentium II 350MHZ, 256mo)
> > 2. Resizing the document window takes 40sec.
> >
> > I attached a quick and dirty patch that improves a little bit the
> > performance:
> > 1. Open: 16sec
> > 2. Resizing: 2sec
> >
> It looks like your performance hack tries to avoid calling the [string]

True.

> method on NSTextStorage, and really saves a lot of time with this. But I
> am not sure, if the way you do it is correct. (Beside you seem to have

Neither I am...

> left out a lot of places, where changes would be needed. We should
> integrate all the changes you made to the functions inside of

That's an option, if GNUstep maintainers do agree.

> NSStringDrawing, but we should also keep the external interface of the
> classes.

Do you mean that adding a method in NSAttributedString.h as a GNUstep
category is not legal?

> I think that this has now been proved. And we will have to hack
> something into NSStringDrawing to make the last needed call to get the
> string faster. As we cannot be sure, if the parameter of type
> NSAttributedString is a GSTextStorage, we better add a method
> [directString] to NSAttributedString and all its subclasses which
> returns the internal string, without copying it. This should have almost
> the same performance benefit than the changes Frederic did propose,
> without further interface changes. 

Would it be possible to return the retained string instead of copying it
and use the "Copy On Modify" strategy? I guess that in most cases (at
least the scenario I worked on), we would benefit from the same
performance speedup.

Frederic



reply via email to

[Prev in Thread] Current Thread [Next in Thread]