Bug 177597

Summary: Speedometer 2.0: Listen for changes to individual attributes in Backbone suite
Product: WebKit Reporter: Shiyu Zhang <shiyu.zhang>
Component: Tools / TestsAssignee: Nobody <webkit-unassigned>
Status: RESOLVED WONTFIX    
Severity: Normal CC: addyo, lforschler, mathias, rniwa
Priority: P2    
Version: WebKit Nightly Build   
Hardware: Unspecified   
OS: Unspecified   
Bug Depends on:    
Bug Blocks: 167652    
Attachments:
Description Flags
Patch for backbone model change binding none

Description Shiyu Zhang 2017-09-28 01:34:59 PDT
Created attachment 322072 [details]
Patch for backbone model change binding

Backbone implementation used to trigger render function twice if a new item is created as reported in https://github.com/tastejs/todomvc/issues/469. A workaround is to filter out the render invocation caused by 'id' change as https://github.com/tastejs/todomvc/pull/755 did.

I think there is a more decent way to fix this issure by binding listeners to specific attributes change of the model. In this way, we only listen to the model attributes that we really care and ignore the 'id' change. It's also more efficient to write specific listeners for different model attributes ('completed' and 'title') change instead of re-rendering the whole todo item once the mode changes. The performance of backbone suite improved 8% after applying this patch.
Comment 1 Ryosuke Niwa 2017-09-28 18:10:46 PDT
No. Please stop making optimizations to the benchmark.

We shouldn't be making the benchmark faster. We should be making the browser engines faster.