[Webkit-unassigned] [Bug 46695] [Qt] Invalid pointer access & incomplete memcmp in setUpIterator

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Mon Feb 14 08:57:46 PST 2011


https://bugs.webkit.org/show_bug.cgi?id=46695





--- Comment #16 from chris reiss <christopher.reiss at nokia.com>  2011-02-14 08:57:45 PST ---
Here are some timing results which motivate this caching.

To recap, the code as it is has two errors, the length if the compare is incorrect and there is a risk of a dangling pointer if iterator.string gets destroyed.

The simple fix is to
   *take a deep copy of the string in Iterator.

The more extensive fix is the above patch (or something like it): https://bugs.webkit.org/attachment.cgi?id=82164, 
which (tries to) protect the string in memory using RefPtr's, and only
recycles Iterators in the path where the performance hit seems to occur.

Here is time spent in  TextBreakIterator* setUpIterator(...), using QtTestBrowser on Ubuntu (debug build, 2.8Gz) for the different alternatives :

----
URL : http://en.wikipedia.org/wiki/List_of_science_fiction_television_programs

  No caching :  36 milliseconds    (here we always create a new iterator.)

  deep copy :   23 milliseconds

  RefPtr appraoch : 16 milliseconds

here is another set of results, using one enormous <div> (attached) :
----
  No caching : 700 milliseconds (ouch)
  deep copy :  9 milliseconds
  RefPtr's  :  5 milliseconds.

-- 
Configure bugmail: https://bugs.webkit.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.



More information about the webkit-unassigned mailing list