googlearchive / observe-js

A library for observing Arrays, Objects and PathValues
1.35k stars 118 forks source link

As used in Polymer, dirty checking performance needs improvement #68

Open sorvell opened 10 years ago

sorvell commented 10 years ago

This issue is relevant only when Object.observe is unavailable.

The topeka app takes ~12ms to do a no-op dirty check in Safari and ~45ms on an iPad. This was determined by timing Platform.performMicrotaskCheckpoint within Polymer's dirty check interval when the app was idle. This jsperf suggests that dirty checking polymer's observed property getters is particularly slow. A quick test to comment out most of the work done in these getters improved the dirty check time by ~33%. Note also that Topeka has about 1200 observers, as reported by Observer._allObserversCount.

jmesserly commented 10 years ago

we'll likely file a polymer issue to make sure we don't trigger dirty checking for scroll events