[Q] RunArray>>, and #copyReplaceFrom:to:with:
Lex Spoon
lex at cc.gatech.edu
Wed Oct 17 03:54:34 UTC 2001
>
> The attached CS speeds RunArray>>, and #copyReplaceFrom:to:with: up by a
> factor of roughly four. All it does is making both runs and values arrays
> (there was some inconsistency between when to use OrderedCollections and
> when not) plus a few minor modifications here and there. The overall result
> for Text>>addAttribute:from:to: seems to be in the range of a factor of two
> (although this may depend since #addAttribute: does some stuff besides).
The reason for OrderedCollections is so that text can be *built* quickly
-- this is important in processing HTML.
Or at least, it used to be. Right now it seems to make a 10% slowdown
for the main Swiki page, so maybe it's not a terribly big deal. Here's the
workspace code for anyone who wants to play with it:
doc := 'http://minnow.cc.gatech.edu/squeak' asUrl retrieveContents.
parsedDoc := HtmlParser parse: doc contentStream
[ parsedDoc formattedText ] timeToRun
-Lex
More information about the Squeak-dev
mailing list
|