-
Notifications
You must be signed in to change notification settings - Fork 131
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Perf #307
Conversation
da016a4
to
8ed08cd
Compare
Polymer.dom.flush(); | ||
// Items should have been rendered prior scrolling to an index. | ||
if (!this._itemsRendered) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Remove _itemsRendered
from the properties
object.
@tgsergeant would you mind trying this out? |
Cool! This is a definite improvement. Here's a trace from chrome://history with this patch applied. It splits the stamping into 5 sections, with around 15-20fps. With devtools CPU throttling turned on, it correctly splits into more sections and maintains a similar frame rate. One thing to consider is that there can be an extra 10-20ms worth of work after the iron-list yields to update layers and paint and so on. This adds on to the 50ms allocated for stamping items, and means that frames can last longer than intended. |
@tgsergeant could you export and share with me the timeline data for both the old and new version? I think I might know why. |
@tgsergeant this commit should fix the issue. Would you mind giving it a try? Also, fyi: PolymerElements/paper-checkbox#149. You should be able to use |
👍, that looks more like it. Thanks! (and yes, we're eagerly awaiting |
so what's the status on this? it'd be really helpful for Chrome's history UI |
@danbeam I'm testing a few things and then it should be ready to merge. |
LGTM |
Ref: #301
Timeline for first paint
Current (waiting 16ms, job=as many nodes as they fit on the list's viewport):
After (waiting for requestIdleCallback, ~50ms job):
Conclusion:
Looking at frames for the offscreen items (the ones after the first frame on the screenshot), we can conclude that this PR does make the app more responsive by yielding control back to the main. It does that by keeping track of the cost of stamping a single template and then estimating how many instances of that template could be grouped into a block of ~50ms as recommended by RAIL
cc @justinfagnani