IRC log of webperf on 2011-04-01
Timestamps are in UTC.
- 16:46:10 [RRSAgent]
- RRSAgent has joined #webperf
- 16:46:10 [RRSAgent]
- logging to http://www.w3.org/2011/04/01-webperf-irc
- 16:46:17 [plh]
- rrsagent, make logs public
- 16:46:35 [Zakim]
- Zakim has joined #webperf
- 16:50:21 [plh]
- Jason: in the ideal, setTimeout would really be 0
- 16:50:59 [plh]
- James: the odds that people will only properly setImmediate properly on popular websites will be slim
- 16:51:20 [plh]
- Jason: if we all go into it together, we have the chance to change the behavior
- 16:56:33 [plh]
- Jason: [shows data]
- 16:57:25 [plh]
- ... 13% of the sites will use setTimeout(0)
- 16:57:45 [plh]
- James: but what if they switch to setImmediate()?
- 16:57:52 [plh]
- Jason: their users will complain
- 16:58:07 [plh]
- James: no, they'll complain to the browser maker
- 16:59:10 [plh]
- Jason: I would love to increase by 60% the perf of [unnamed website]...
- 17:00:06 [plh]
- Cameron: I share the same concern about people misusing the API
- 17:00:43 [plh]
- ... do website break if you remove the clamp or do they eat the cpu?
- 17:01:02 [plh]
- James: we only clamp nested setTimeout(0)
- 17:01:08 [plh]
- s/(0)//
- 17:01:51 [plh]
- James: the first setTimeout(0) is free for us. if the script goes in a loop, we'll clamp
- 17:02:40 [plh]
- James: with postMessage, you can build something similar as well. nobody clamp that today...
- 17:04:11 [plh]
- Jason: I'm not hearing a lot of enthusiast ...
- 17:04:29 [plh]
- Steve: i'll be interested in doing something with setTimeout(0)
- 17:05:11 [plh]
- James: we got burned by setTimeout(0), we'll get burn with setImmediate() as well...
- 17:05:25 [plh]
- ... we'll have to clamp it
- 17:06:01 [plh]
- Steve: let's call it lockMyCPu()
- 17:06:09 [plh]
- ... :)
- 17:06:24 [plh]
- Jason: is there agreement we should do something
- 17:06:49 [plh]
- James: we're worried about power consumption, but do you change the API or the current implementation?
- 17:06:56 [plh]
- ... we're working on the implementation side
- 17:07:10 [plh]
- ... changing the timer, etc.
- 17:07:25 [plh]
- .... nested setTimeout/setInterval, modifying the clamp
- 17:07:36 [plh]
- ... lots of things you can do to get better performance
- 17:07:45 [plh]
- Steve: should we spec those things?
- 17:09:17 [plh]
- Plh: how about writing some guidelines on how to use setTimeout(0) properly?
- 17:09:34 [plh]
- Jason: would take time to change the behaviors
- 17:10:12 [plh]
- Steve: you can also detect the situation and report it possibly
- 17:11:43 [plh]
- ... evangelism would still be good to do
- 17:11:56 [plh]
- ... like change setTimeout(0) to setTimeout(16)
- 17:13:12 [plh]
- Cam: even if the new API gets deployed, it will be a lot of overhead for implementation and won't improve the situation
- 17:13:42 [mdelaney]
- jamesr: hey! (belated)
- 17:14:07 [plh]
- James: getting some feedback from javascript devs would be good
- 17:14:26 [heycam]
- s/it will be a lot of overhead/it won't be a lot of overhead/
- 17:14:43 [heycam]
- s/won't improve the situation/we'll just be in the same situation as now/
- 17:15:10 [heycam]
- so it's not terrible, if we implement setImmediate and people end up misusing it
- 17:17:33 [plh]
- Topic: Page Visibility
- 17:19:55 [plh]
- zakim, room for 4?
- 17:19:56 [Zakim]
- ok, plh; conference Team_(webperf)17:19Z scheduled with code 26631 (CONF1) for 60 minutes until 1819Z
- 17:20:12 [plh]
- zakim, passcode?
- 17:20:12 [Zakim]
- the conference code is 26631 (tel:+1.617.761.6200 tel:+33.4.26.46.79.03 tel:+44.203.318.0479), plh
- 17:20:48 [Zakim]
- Team_(webperf)17:19Z has now started
- 17:20:55 [Zakim]
- +tomayac_
- 17:21:30 [Zakim]
- +[MicrosoftSVC]
- 17:22:40 [Zakim]
- + +1.617.575.aaaa
- 17:25:28 [plh]
- zakim, drop aaaa
- 17:25:28 [Zakim]
- +1.617.575.aaaa is being disconnected
- 17:25:29 [Zakim]
- - +1.617.575.aaaa
- 17:26:08 [Zakim]
- + +1.617.575.aabb
- 17:26:51 [Jatinder]
- http://lists.w3.org/Archives/Public/public-webapps/2011JanMar/0175.html
- 17:28:31 [Jatinder]
- Arvind: Alex, please talk about this proposal. We are projecting the proposal.
- 17:28:52 [Jatinder]
- Alex: When a page is being prerendered so it can behave approperiately.
- 17:29:21 [Jatinder]
- ....There are currently a number of heuristics that a user is viewing your webpage, but there is no
- 17:29:31 [Jatinder]
- ...good way to determine when you page is not visible.
- 17:30:10 [Jatinder]
- ...the proposal is only suggesting a few simple APIs. document.visible returns the current visible state of the page.
- 17:31:32 [plh]
- does visible mean that it's likely that more than 0% of the page is visible?
- 17:31:38 [Jatinder]
- ....document.visibilityState describes the visible state. When "visible" it is likely that the page is visible. When "hidden" it is guaranteed that the page is hidden.
- 17:32:11 [Jatinder]
- Arvind: Not sure if everyone knows what pre-rendering is. When a page embeds a link into a page, Chrome will go load the link in a hidden tab before the user clicks on it.
- 17:32:42 [Jatinder]
- ...the API is mostly motivated by that. So when the user clicks on a link, it will make it really fast because the page is already visible.
- 17:33:22 [Jatinder]
- ....We're going siginificantly further than current Firefox implementation and loading the entire page. Before the user actually clicks on the link, if we run the script from the hidden page
- 17:33:45 [Jatinder]
- ...there could be some side effects. This API will help give the visibility so we don't run script before the page is shown.
- 17:34:44 [Jatinder]
- ...There are other use cases where this is useful. For example, analytics metrics are broken because its not determinstic whether the user is actually looking at a visible page.
- 17:35:18 [Jatinder]
- ...Jason also mentioned the case where when the tab is actually hidden, we don't want to set as much resources on that page. E.g., When a page is not visible, we don't want to play video if the user can't see it.
- 17:35:37 [Jatinder]
- ...That was the background. The goal today was let's look at the API and see what we all think about it.
- 17:36:17 [Jatinder]
- Jason: We agree with the visibility concept. We shouldn't use resources when in background.
- 17:37:05 [Jatinder]
- ...We had some concerns with the current naming. document.visible may have collisions with other APIs.
- 17:37:42 [Jatinder]
- Alex: We haven't done any crawls, but with document, someone would have to explictly add to the document name. I don't think this is a common pattern.
- 17:38:03 [Jatinder]
- Steve: I bet folks are less likely to extend document than window.
- 17:38:13 [Jatinder]
- Jason: What about other states? We have peek in Windows 7?
- 17:38:53 [Jatinder]
- Alex: document.visibleState defines a common of states like "preview", something that Windows 7 could use.
- 17:39:01 [Jatinder]
- Steve: Can it be a value that is not mentioned here?
- 17:39:19 [Jatinder]
- Alex: The proposal explictly made it clear that future values could be added with a vendor prefix.
- 17:39:58 [Jatinder]
- Zhiheng: Prerender and cache both seem to be depend on current implementation. Even from a standard point of view, we should make sure the implementation is the same across browsers.
- 17:40:02 [Jatinder]
- Alex: Couldn't hear you.
- 17:40:14 [Jatinder]
- Zhiheng: What about prerendering if a browser doesn't implement it?
- 17:40:55 [Jatinder]
- Steve: Zhiheng's point is that the verbage should be clear that one browser's definition of prerender doesn't differ from another browser, so it would confuse web developers.
- 17:41:27 [Jatinder]
- Arvind: Zhiheng's other point was cache.
- 17:41:34 [Jatinder]
- Jatinder: How is the cache value useful?
- 17:41:50 [Jatinder]
- Alex: We could just move that one and it should be fine.
- 17:42:28 [Jatinder]
- Ben: Should their be a private state that protects you?
- 17:42:44 [plh]
- if (page.visible) { showAdAndPlayFanfare(); }
- 17:42:53 [Jatinder]
- Jatinder: Agree. I wouldn't want an IM chat site to know when I'm not looking at the site and notify other users.
- 17:43:12 [Jatinder]
- Alex: You can use onBlur() today to see if users are using the site.
- 17:43:28 [Jatinder]
- Jason: Also, if the site is visible it doesn't mean the user is there.
- 17:43:35 [plh]
- if (!page.visible) { startFireAlarm(); }
- 17:43:50 [Jatinder]
- Ben: I'm more worried about the hidden state.
- 17:44:14 [Jatinder]
- Arvind: We should talk about the two properties. Visible or not and the other one with the states.
- 17:45:32 [Jatinder]
- Jatinder: Should we make it more granular? I'm in the background tab vs. the computer is asleep.
- 17:45:50 [Jatinder]
- Alex: We can extend. I can definitely see cases where it's a background tab, or it's hidden.
- 17:46:04 [Jatinder]
- Alex: We want the prerendered case to help that scenario.
- 17:46:21 [Jatinder]
- Cameron: You can do the prerender with existing events.
- 17:46:56 [Jatinder]
- Alex: If we were developing just for prerendered case, we could have made a simpler api.
- 17:47:09 [Jatinder]
- Jason: The general use case is interesting.
- 17:48:33 [Jatinder]
- Tony: It'll be interesting to see the difference between sleep and background tab case. Maybe a low battery notification?
- 17:49:13 [Jatinder]
- Arvind: So the question is, should we go ahead and start working on it?
- 17:49:59 [Jatinder]
- Jason: I think it's clear that we should do the visibility work. We should start working on the spec.
- 17:50:26 [Jatinder]
- Steve: It's interesting because from an ad's point of view, this isn't really perf related. But the prerendering makes it perf related.
- 17:50:34 [Jatinder]
- Steve: Seems like a very useful API.
- 17:51:51 [Jatinder]
- Arvind: Is there anyone interested in the editing the spec?
- 17:51:58 [Jatinder]
- James: Is there any more to edit?
- 17:52:09 [Jatinder]
- Arvind: Yes, this isn't even in the spec format.
- 17:52:18 [Jatinder]
- Jason: We are willing to help edit.
- 17:52:21 [Jatinder]
- Arvind: Good.
- 17:52:37 [Jatinder]
- Cameron: Is this even in the Charter?
- 17:53:51 [Jatinder]
- Jason: Are we going to remove the cache event?
- 17:54:05 [Jatinder]
- Alex: I'm fully supported to removing it.
- 17:54:20 [plh]
- --> http://lists.w3.org/Archives/Public/public-device-apis/2009Apr/att-0001/sysinfo.html#batteryleveldata_interface Nokia's proposal for battery level
- 17:54:25 [Jatinder]
- Christian: I don't think it's a particularly useful usecase.
- 17:54:49 [Jatinder]
- Arvind: From a Chrome's implementation point of view, I think we've only done visible or not.
- 17:55:19 [plh]
- --> http://bondi.omtp.org/1.1/apis/devicestatus.html The BONDI devicestatus Module
- 17:55:27 [Jatinder]
- Arvind: isVisible would return false for prerendered case?
- 17:55:45 [Jatinder]
- Shishir: Yes.
- 17:56:35 [Zakim]
- - +1.617.575.aabb
- 17:56:35 [plh]
- Topic: Paint Notification
- 17:56:36 [Zakim]
- -tomayac_
- 17:56:37 [Jatinder]
- Moving on to Paint Notification.
- 18:02:23 [Jatinder]
- Cameron: The goal for the paint notification is to give the browser the ability paint when it needs to.
- 18:03:26 [plh]
- --> http://blog.pearce.org.nz/2011/03/html5-video-painting-performance.html HTML5 Video painting performance statistics in Firefox 5
- 18:05:10 [Jatinder]
- Cameron: This is the basic API: window.requestAnimationFrame( function(t) { }
- 18:05:22 [plh]
- --> https://developer.mozilla.org/en/DOM/window.mozRequestAnimationFrame Mozilla's requestAnimationFrame
- 18:05:22 [Jatinder]
- Cameron: Slight differences between webkit and mozilla's implementations.
- 18:06:01 [Jatinder]
- James: Imagine you have a canvas or a banner ad, you can avoid painting for something that is off screen or not visible.
- 18:06:11 [plh]
- -> http://webstuff.nfshost.com/anim-timing/Overview.html Timing control for script-based animations
- 18:07:05 [plh]
- zakim, drop Microsoft
- 18:07:05 [Zakim]
- sorry, plh, I do not see a party named 'Microsoft'
- 18:07:09 [plh]
- zakim, drop MicrosoftSVC
- 18:07:09 [Zakim]
- [MicrosoftSVC] is being disconnected
- 18:07:11 [Zakim]
- Team_(webperf)17:19Z has ended
- 18:07:13 [Zakim]
- Attendees were tomayac_, [MicrosoftSVC], +1.617.575.aaaa, +1.617.575.aabb
- 18:12:12 [Jatinder]
- Jatinder: Why isn't this just simpler like onPaint(func callback)? The UA would determine when is the best time to make the callback, e.g., before you paint.
- 18:12:38 [Jatinder]
- Jason: Painting and animation frames is a bit complimentary.
- 18:13:43 [Jatinder]
- Jason: The current API wouldn't give the script the ability to control the paint.
- 18:14:30 [Jatinder]
- Jason: What happens when you drop to 30Hz, how the script deal with that?
- 18:14:58 [Jatinder]
- Jason: Would you be able to align the frequency of the paint updates (display frequency) with how often you do the callback?
- 18:16:58 [Jatinder]
- James: With requestFrameAnimation you can make better decisions, because with setTimeout you don't know why they're doing.
- 18:17:36 [Jatinder]
- Jason: Let me show a demo.
- 18:17:54 [Jatinder]
- James: Sure.
- 18:19:10 [Jatinder]
- Jason: Wouldn't you always want to match the display rate?
- 18:19:32 [Jatinder]
- James: Not exactly. What if you're video is running at a slower rate and you want your animation to match that?
- 18:22:08 [Jatinder]
- Jason: Showing http://ie.microsoft.com/testdrive/Performance/PsychedelicBrowsing/Default.html
- 18:22:21 [Jatinder]
- Jason is running an xperf trace.
- 18:27:11 [Jatinder]
- James: How do you know when to fire the timer?
- 18:28:32 [Jatinder]
- James: Let's say I'm in a background tab, and I'm running a timer. How do you know when it's related to graphics work?
- 18:29:47 [Jatinder]
- Jason: We feel that we've solved a lot of these problems by aligning to the display time.
- 18:30:31 [Jatinder]
- Cameron: Theres not much difference how it's done between setTimeout and requestAnimationFrame
- 18:32:00 [Jatinder]
- Jason: We should solve the case where you see flicker on a resize.
- 18:34:01 [Jatinder]
- James: This API has got a lot of good response from the Javascript libraries.
- 18:34:21 [Jatinder]
- Cameron: I like to know which of things you were discussing, Jason, that would impact that API?
- 18:34:40 [Jatinder]
- ...the stuff about the vblank didn't seem like a required part.
- 18:35:08 [Jatinder]
- Jason: The APIs are just fine. I'm not sure what the additional value is that the setInterval model we have today.
- 18:36:40 [Jatinder]
- Jason: We haven't found cases where we are guessing wrong. I'm a big fan of better APIs in the platform that would solves these problems. But they come with the cost of more cost, learn new patterns, best practices.
- 18:36:52 [Jatinder]
- James: The interesting thing is the way it interacts with animations APIs.
- 18:37:59 [Jatinder]
- ..theres work going to improve the ability of frame based animation.
- 18:38:36 [Jatinder]
- Cameron: There were things you were mentioning like synchronizing the names of the animations.
- 18:39:21 [Jatinder]
- James: As we get more script control of this animation, right now the script base control is not very powerful. Script based animation and declaritive animation is off on it's own.
- 18:39:30 [tonyg]
- tonyg has joined #webperf
- 18:40:28 [Jatinder]
- Jason: We should make sure that frames are not dropped. Curently it's possible with setInterval, setTimeout
- 18:48:39 [Jatinder]
- Jason: Does Firefox vblank align?
- 18:48:43 [Jatinder]
- Cameron: I don't know.
- 18:49:03 [Jatinder]
- Christian: No, I don't believe so.
- 18:49:24 [Jatinder]
- Cameron: So you'd always want to drop to 30 frames but never 50 frames? Also half?
- 18:49:29 [Jatinder]
- Always* half?
- 18:49:57 [Jatinder]
- Jason: Game developers usually go down to half.
- 18:50:16 [Jatinder]
- James: Worse is 60, 59, 60. Looks visually bad.
- 18:50:26 [Jatinder]
- Cameron: Are you looking to building these in as requirements?
- 18:50:48 [Jatinder]
- Jason: Yes, it would be good to have these are requirements. We should talk to game developers, and partners see what their thinking.
- 18:51:14 [Jatinder]
- James: It may be difficult to enforce a requirement. Imagine a test case.
- 18:51:28 [Jatinder]
- James: We want to help provide a consistent rendering experience. That'd be good.
- 18:53:48 [Jatinder]
- James: I saw most javascript library seems to use setInterval. It shouldn't be hard to change libraries.
- 18:54:13 [Jatinder]
- Cameron: If you noticed that animation is done, you could always throttled down.
- 18:54:23 [Jatinder]
- James: It may be hard to tell.
- 18:55:33 [Jatinder]
- Jason: The objectives seems like you want an ability to throttle down, control frame rate, it would be better if there was a vblank alignment. Do you agree with these objectives?
- 18:56:07 [Jatinder]
- Cameron: I agree that the vblank alignment would be good for better quality. Not sure how that impacts the API. Maybe a mention in the spec.
- 18:56:28 [Jatinder]
- Cameron: I should follow up and ask people if their intention was to vblank align with this.
- 18:57:02 [Jatinder]
- Cameron: Another thing Zhiheng had brought up before was synchronizing with video. Maybe that is something else we can align with.
- 20:08:16 [mdelaney]
- mdelaney has joined #webperf
- 20:23:37 [heycam]
- jamesr, plh, http://dev.w3.org/html5/spec/timers.html#timers
- 20:28:01 [Zakim]
- Zakim has left #webperf
- 20:41:28 [Jatinder]
- rrsagent, create minutes
- 20:41:28 [RRSAgent]
- I have made the request to generate http://www.w3.org/2011/04/01-webperf-minutes.html Jatinder
- 20:43:46 [Jatinder]
- rrsagent, please part
- 20:43:46 [RRSAgent]
- I see no action items