Skip to content

Tweaks to improve style application performance #2145

Description

@maxkfranz

Issue type

Feature request

Description of new feature

Make tweaks to the styler in order to improve style application performance, especially at element creation during initialisation.

  • Stylesheet.prototype.style() iterates over Object.keys(passedStyleJson) rather than Style.properties.
  • Check for mapper updates only to the list of currently-active properties.
  • Iterate over existing style properties in the element for element cleaning on applying a new stylesheet, instead of iterating over all possible props.
  • Improve performance of style property parsing by using cheap heuristics to avoid regex mapper checks
  • Cache default properties without memoize()
  • Slightly cheaper checks in ele.isSimple() and ele.isLoop()
  • Document how to start from an empty stylesheet
  • Refactoring of Selector, esp. w.r.t. matching

Motivation for new feature

Faster init time and faster style changes

Metadata

Metadata

Assignees

No one assigned

    Labels

    performanceImproving speed and memory usage

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions