Summary

Dirk Mueller mueller@kde.org
Thu, 20 Feb 2003 11:07:52 +0100


On Don, 20 Feb 2003, Lars Knoll wrote:

> >   re: misc/decoder.cpp: Our code is crap basically, as we don't do
> >   automatic encoding guessing properly and are by far wrong in many cases.
> Yes. The autodetection needs quite some work.

JFYI I've heard that MakSim is currently working on fixing this properly. He 
even sent me a preliminary patch (which I can't find right now..). 

> I'll bite into my keyboard if it's slower than the old code ;-)

You can't chew those too easily, I've some experience there as well. 

> The old parser relied on thousands of string comparisons, while we now do most 
> of the work in a state machine. The old code was doing a huge amount of 
> string copying, simplifyWhiteSpace calls etc. All this went away. 

Ah, it wasn't *that* bad. we did some string sharing before. The problem 
was that we passed the same string all around everywhere and had a global 
"state pointer" for the string and only a single char lookup in most 
cases, which broke horribly for selectors with spaces in unexpected places..

Anyway, the current code is a lot better, and even if it has speed issues, 
I'm pretty sure we can fix those. I'll see about finding some 
realworld huge css styles which we can add to khtmltests/stresstests and 
benchmark it. As we parse style sheets in one-go, we should be reasonably 
fast to avoid that we block the engine long enough for the user to notice 
it.

> Anyway, the CSS parser was never a speed bottleneck, it's the style selector 
> that could need further tuning.

.. and I have some ideas for improvements there and playing with it. However 
inline layouting is imho more important right now. 

> need the rewrite of the inline box model), and I haven't seen a bug on real 
> world web page I could assign to the css parser for some time now. 

I don't know of any CSS parser related regression currently either. My 
biggest fear are memory leaks right now, but valgrind shows that there are 
none on the common webpages. It looks good to me right now, but I haven't 
sifted the 400 new bugreports we got during the last month yet..


-- 
Dirk (received 242 mails today)