Bug 33254 - Batch DOM changes
Summary: Batch DOM changes
Status: RESOLVED WONTFIX
Alias: None
Product: WebKit
Classification: Unclassified
Component: Layout and Rendering (show other bugs)
Version: 528+ (Nightly build)
Hardware: PC All
: P2 Enhancement
Assignee: Nobody
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-01-06 05:52 PST by chrome
Modified: 2010-01-07 08:22 PST (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
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.