Implementing WebTiming as a part of HTML5

View: New views
3 Messages — Rating Filter:   Alert me  

Implementing WebTiming as a part of HTML5

by Pavel Feldman :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

I've been asked to look at the WebTiming proposal wrt implementing it in WebKit. Any objections / suggestions or hints? Please find proposal brief below.

Pavel

<< Pasting proposal brief below >>

User latency is an important quality benchmark for Web Applications. While
JavaScript-based mechanisms can provide comprehensive instrumentations for user
latency measurements within an application, in many cases, they are unable to
provide a complete end-to-end latency picture.

For example, the following Javascript shows the time it take to fully load a
page:

<html>
<head>
<script type="text/javascript">
var start = new Date().getTime();
function onLoad() {
var now = new Date().getTime();
var latency = now - start;
alert("page loading time: " + latency);
}
<script>
</head>
<body onload="onLoad()">
<!- Main page body goes from here. -->
</body>
</html>

The script calculates the time it takes to load the page after the first bit of
JavaScript in the head is executed, but it does not give any information about
the time it takes to get the page from the server.

To address the need for complete information on the user experience, this
document introduces the Timing interface. This interface allows JavaScript
mechanisms to provide complete client-side latency measurements within
applications. With the proposed interface, the previous example could be
modified to provide information about user's perceived page load time.

The following script calculates how much time has elapsed since the occurance
of a navigation event, such as the mouse click on a link.

<html>
<head>
<script type="text/javascript">
function onLoad() {
var now = new Date().getTime();
var latency = now - window.pageTiming.navigationTime;
alert("User-perceived page loading time: " + latency);
}
<script>
</head>
<body onload="onLoad()">
<!- Main page body goes from here. -->
</body>
</html>


_______________________________________________
webkit-dev mailing list
webkit-dev@...
http://lists.webkit.org/mailman/listinfo.cgi/webkit-dev

Re: Implementing WebTiming as a part of HTML5

by Darin Adler :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Has there been any discussion of or feedback about the web timing  
proposal?

Would WebKit’s implementation of this be the first one?

Is someone planning on building a benchmark that uses this new feature  
to evaluate browser speed?

     -- Darin

_______________________________________________
webkit-dev mailing list
webkit-dev@...
http://lists.webkit.org/mailman/listinfo.cgi/webkit-dev

Re: Implementing WebTiming as a part of HTML5

by Pavel Feldman :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Please see inline.

Thanks
Pavel

On Thu, Oct 29, 2009 at 11:12 PM, Darin Adler <darin@...> wrote:
> Has there been any discussion of or feedback about the web timing proposal?
>

Not much of feedback yet.

> Would WebKit’s implementation of this be the first one?
>

Variation of this is supported in Chromium.

> Is someone planning on building a benchmark that uses this new feature to
> evaluate browser speed?
>

I am not aware of such plans. The idea is that web masters can get a
clue on user-perceived client side latency, especially related to the
initial loads and redirects.

>    -- Darin
>
>
_______________________________________________
webkit-dev mailing list
webkit-dev@...
http://lists.webkit.org/mailman/listinfo.cgi/webkit-dev