Skip to content

Modifying unpublished properties on a polymer element causes a lot of observe-js work #844

@PolymerCommunityBot

Description

@PolymerCommunityBot

Issue by kevinpschaaf
Thursday Sep 25, 2014 at 02:31 GMT
Originally opened as https://github.com/Polymer/polymer-dev/issues/101


Unexpected cost: Modifying any property on a polymer element (particularly an unobserved property) causes observe-js to do a ton of unexpected/extra work.

This was stumbled upon in the sample in the following gist, which was attempting to measure how often the browser sends scroll events while scrolling. observe-test-a.html appends text to this.deltas (instance property of list-test element) every scroll event, recording the time between scroll frames. Note this.deltas is not used by any bindings or otherwise explicitly published/observed. In observe-test-b.html, deltas is moved to a variable not on the element, and the observe-js work per event goes away, reducing the time between scroll events substantially (click the menu icon to see the deltas text in an overlay).

https://gist.github.com/kevinpschaaf/b12d38796be25a0ce5fe

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions