Bug 33254

Summary: Batch DOM changes
Product: WebKit Reporter: chrome
Component: Layout and RenderingAssignee: Nobody <webkit-unassigned>
Status: RESOLVED WONTFIX    
Severity: Enhancement CC: chrome
Priority: P2    
Version: 528+ (Nightly build)   
Hardware: PC   
OS: All   

Description chrome 2010-01-06 05:52:53 PST
How about implementing a "batch-mode" for DOM-changes? It should collect changes to layout etc., suppress rendering and do all rendering when batch mode is ended. This should speed up rendering for a huge amount of scenarios afaik:


document.engine.batch=true;

element.width=100
element.height=100
...

document.engine.batch=false;

...
Comment 1 Alexey Proskuryakov 2010-01-06 10:50:56 PST
I'm pretty sure WebKit doesn't do layout or rendering in this scenario. It's only performed after script execution finishes, or when it's necessary for further processing (e.g. if the script asks for element size).
Comment 2 chrome 2010-01-07 08:22:23 PST
I agree, but I am still wondering what is the "slow" part, calculating sizes or putting things on screen? If it's "drawing" a batch-mode would still have some effect. 

I see that this might break webkits rendering logic and isn't easy or even useful to implement.

All this told me that keeping sizes in my script and reusing them as much as possible, is the only way to squeeze out some speed. This answers some questions I had asked in several related groups, but didn't get an answer. Thank you.