From: bdash Date: Thu, 5 Oct 2006 21:40:04 +0000 (+0000) Subject: 2006-10-05 David Carson X-Git-Url: https://git.webkit.org/?p=WebKit-https.git;a=commitdiff_plain;h=d5ce72de18362f61655c2e28910ec91c6f6af53b 2006-10-05 David Carson Reviewed by Darin. http://bugs.webkit.org/show_bug.cgi?id=11152 Adjust the tokenizer chunk size to be smaller for mobile devices, and also decrease the yield timer for the tokenizer so that it can resume earlier. * html/HTMLTokenizer.cpp: * config.h: git-svn-id: https://svn.webkit.org/repository/webkit/trunk@16821 268f45cc-cd09-0410-ab3c-d52691b4dbfc --- diff --git a/WebCore/ChangeLog b/WebCore/ChangeLog index 4ac88d15f9db..1726aa8ac73e 100644 --- a/WebCore/ChangeLog +++ b/WebCore/ChangeLog @@ -1,3 +1,15 @@ +2006-10-05 David Carson + + Reviewed by Darin. + + http://bugs.webkit.org/show_bug.cgi?id=11152 + Adjust the tokenizer chunk size to be smaller for + mobile devices, and also decrease the yield timer + for the tokenizer so that it can resume earlier. + + * html/HTMLTokenizer.cpp: + * config.h: + 2006-10-05 Adam Roben Removing accidentally-checked-in do-nothing code. diff --git a/WebCore/config.h b/WebCore/config.h index 876d22bfd0a8..e120d7c16b54 100644 --- a/WebCore/config.h +++ b/WebCore/config.h @@ -21,6 +21,7 @@ #include #define XSLT_SUPPORT 1 +#define MOBILE 0 #if __APPLE__ #define HAVE_FUNC_USLEEP 1 diff --git a/WebCore/html/HTMLTokenizer.cpp b/WebCore/html/HTMLTokenizer.cpp index 8055fb80dee5..e2998ab1b3e9 100644 --- a/WebCore/html/HTMLTokenizer.cpp +++ b/WebCore/html/HTMLTokenizer.cpp @@ -46,7 +46,14 @@ // #define INSTRUMENT_LAYOUT_SCHEDULING 1 +#if MOBILE +// The mobile device needs to be responsive, as such the tokenizer chunk size is reduced. +// This value is used to define how many characters the tokenizer will process before +// yeilding control. +#define TOKENIZER_CHUNK_SIZE 256 +#else #define TOKENIZER_CHUNK_SIZE 4096 +#endif using namespace std; @@ -55,10 +62,17 @@ namespace WebCore { using namespace HTMLNames; using namespace EventNames; +#if MOBILE +// As the chunks are smaller (above), the tokenizer should not yield for as long a period, otherwise +// it will take way to long to load a page. +const double tokenizerTimeDelay = 0.300; + +#else // FIXME: We would like this constant to be 200ms. // Yielding more aggressively results in increased responsiveness and better incremental rendering. // It slows down overall page-load on slower machines, though, so for now we set a value of 500. const double tokenizerTimeDelay = 0.500; +#endif static const char commentStart [] = "