gnustep-dev
[Top][All Lists]
Advanced

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

Re: r28556 - in /libs/gui/trunk: ChangeLog Source/GSTextStorage.h Source


From: Wolfgang Lux
Subject: Re: r28556 - in /libs/gui/trunk: ChangeLog Source/GSTextStorage.h Source/GSTextStorage.
Date: Mon, 8 Feb 2010 08:41:03 +0100

Hi Richard,

Author: rfm
Date: Thu Aug 27 16:57:00 2009
New Revision: 28556

URL: http://svn.gna.org/viewcvs/gnustep?rev=28556&view=rev
Log:
Fix bad return of proxy to user code

Modified:
    libs/gui/trunk/ChangeLog
    libs/gui/trunk/Source/GSTextStorage.h
    libs/gui/trunk/Source/GSTextStorage.m


I don't know what you attempted to fix here, but your change is definitely
wrong and the old code which did return a proxy was correct. Here is the
relevant quote from Apple's documentation of the NSAttributedString - string
method:

"For performance reasons, this method returns the current backing store of the attributed string object. If you want to maintain a snapshot of
  this as you manipulate the returned string, you should make a copy of
  the appropriate substring.
This primitive method must guarantee efficient access to an attributed string's characters; subclasses should implement it to execute in O (1)
  time."

Your change has introduced a nasty O(n^2) performance bug that makes a
machine with a GB of RAM start thrashing during text layout when loading
a ~100kB log file into a text view.

Wolfgang

PS: I've notice that GSAttributedString contains the same bug.





reply via email to

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