JS document.xxx is really slow

Koos Vriezen koos.vriezen at xs4all.nl
Sat Nov 16 00:37:44 GMT 2002


On Sat, 16 Nov 2002, David Faure wrote:

> About the patch: some namings are a bit confusing, e.g.
> TagLength has a length attribute, but NamedTagLengthDeterminer has one too
> (which is in fact 3, the number of tags to look for - can you call that one numberOfTags or nrTags?)

Sure :)

> In fact I would even suggest that a private helper method might be enough for
> this, an actual separate class isn't necessary (since it's created/destroyed each
> time). The private member vars would become the local vars of the private method.

No, because its a recursive func, would need to pass all these
variables each time. I think using a function object is faster (it's also
created on the stack here).
(Well, I use it as a function object, not sure if I should add
 'void operator (...)' to make it a real function object...)

> Well, that's just nitpicking for code readability, I hope you'll forgive me for that :)

Of course :). I even appreciate these kind of comments (I always find it
hard to come up with good names, english is so much more difficult than
c++)

> Feel free to apply whichever variant (btw some comments need to be moved, etc.).

Ok and I'll delete all those lines that are now commented out in this
patch.

Koos





More information about the kfm-devel mailing list