Hello, I think there is a problem in the following function : double currentTime() { time_t ttime; time(&ttime); return (double)ttime; } from the file WebCore/platform/gdk/SystemTimeLinux.cpp. With this code, time is rounded to the second. Result is that display is slow, because timers are delayed too much. A fix could be to use the gettimeofday function: double currentTime() { struct timeval aTimeval; struct timezone aTimezone; gettimeofday( &aTimeval, &aTimezone ); return (double)aTimeval.tv_sec + (double)(aTimeval.tv_usec / 1000000.0 ); } I have tested it and now display is immediate on many pages. Layout tests are executed nearly four time faster. Does someone confirm this is a bug ? Do i need to fill in a bug and post a patch ? Thanks. Ronan -- Ronan Meneu Origyn Web Browser for Embedded Systems Team Senior Software Engineer
On 29.08.2006 13:46, "Ronan Meneu" <rmeneu@origyn.fr> wrote:
With this code, time is rounded to the second. Result is that display is slow, because timers are delayed too much.
A fix could be to use the gettimeofday function:
You are absolutely right, this function is supposed to provide sub-second precision. For SystemTime.h: // Return the current system time in seconds, using the classic POSIX epoch of January 1, 1970. // Like time(0) from <time.h>, except with a wider range of values and higher precision. gettimeofday() doesn't really provide a much wider range of values, but that doesn't seem critical for the time being :-)
Do i need to fill in a bug and post a patch ?
It will certainly be appreciated. Thank you! - WBR, Alexey Proskuryakov
That's in both the qt port and gdk thanks. And I'm the one to blame. I don't know if qt has a api for this but if it does then the fix there may be to use the qt portable api if it exists. Thanks. On 8/29/06, Ronan Meneu <rmeneu@origyn.fr> wrote:
Hello,
I think there is a problem in the following function :
double currentTime() { time_t ttime; time(&ttime); return (double)ttime; }
from the file WebCore/platform/gdk/SystemTimeLinux.cpp. With this code, time is rounded to the second. Result is that display is slow, because timers are delayed too much.
A fix could be to use the gettimeofday function:
double currentTime() { struct timeval aTimeval; struct timezone aTimezone;
gettimeofday( &aTimeval, &aTimezone ); return (double)aTimeval.tv_sec + (double)(aTimeval.tv_usec / 1000000.0 ); }
I have tested it and now display is immediate on many pages. Layout tests are executed nearly four time faster.
Does someone confirm this is a bug ? Do i need to fill in a bug and post a patch ?
Thanks.
Ronan
-- Ronan Meneu Origyn Web Browser for Embedded Systems Team Senior Software Engineer _______________________________________________ webkit-dev mailing list webkit-dev@opendarwin.org http://www.opendarwin.org/mailman/listinfo/webkit-dev
Am Dienstag, 29. August 2006 18:23 schrieb Mike Emmel:
That's in both the qt port and gdk thanks. And I'm the one to blame. I don't know if qt has a api for this but if it does then the fix there may be to use the qt portable api if it exists.
Thanks.
Hello Mike & Ronan, that's exactly the bug I was seeing with libcurl & Qt. In a recent patch I dropped the libcurl usage in favour of using KDE's KIO mechanism, which made layout tests fly compared to the weird behaviour with libcurl. That may explain it :-) Good catch, Ronan! Ah and Mike, I think we should chat about about sharing some parts of the Gdk/Qt platform code in a general platform/linux directory. Feel free to drop me a lines, then we can maybe meet on IRC. Kind regards, Niko
participants (4)
-
Alexey Proskuryakov
-
Mike Emmel
-
Nikolas Zimmermann
-
Ronan Meneu