[Q] RunArray>>, and #copyReplaceFrom:to:with:
Lex Spoon
lex at cc.gatech.edu
Wed Oct 17 16:39:46 UTC 2001
>
> > The reason for OrderedCollections is so that text can be
> > *built* quickly -- this is important in processing HTML.
>
> Yes, I am well aware of this - and I checked the implications beforehand.
> You only pay a (minor) price when a new run begins, in all other cases the
> tweaks make it much faster than before. Thus, if your runs are not extremely
> short you'll win in the big picture.
This case happens a LOT for formatting HTML. Every link, bold, italics,
indentation, and font-size change all start a new set of text
attributes. It's really a downer -- Squeak can handle batch execution
of anything by adding a primitive for it, but Html pages are made up of
lots of little segements that, with my lack of cleverness, ended up
being processed one by one.
>
> > 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.
>
> 10% slowdown?! Sounds strange. No matter how hard I try I'm not seeing a
> slowdown - in fact, I'm seeing a slight speedup (in the range of 3%). And
> that's certainly not amazing considering the above.
>
What can I say? Your download didn't fail, did it, leaving you
formatting an empty page? Here are my timings, this time with 10
executions instead of just 1:
OrderedCollection: 464 464 463 464 460 avg: 463
Array: 496 497 495 496 479 avg: 492.6
difference: (492.6 - 463) / 463.0 * 100 ==> 6.39
Okay, it's less than 10%, but it's there. And I still don't think it's
a terribly big deal -- there are probably bigger speedups to be had in
the HTML formatter than this, and anyway, it's fast enough for the pages
I actually use with Scamper.
At the time, though, nothing seemed more important than speeding up HTML
formatting!
-Lex
PS -- sure wish I could have just "unloaded" Andreas's patch to do the
comparison, instead of removing it method by method!
More information about the Squeak-dev
mailing list
|