Page MenuHomePhabricator

Calling debounced updateThemeClasses multiple times per widget might be slow?
Closed, ResolvedPublic1 Estimate Story Points

Description

Calling debounced updateThemeClasses multiple times per widget might be slow? I'm seeing it pop up all over the place in Chrome dev tools profiler. We're setting up and then removing several timers when constructing some widgets with many mixins (e.g. ButtonWidget), not sure how bad this is.

Event Timeline

matmarex created this task.Feb 12 2016, 5:51 PM
matmarex raised the priority of this task from to Needs Triage.
matmarex updated the task description. (Show Details)
matmarex added a project: OOUI.
matmarex added a subscriber: matmarex.
Restricted Application added subscribers: StudiesWorld, Aklapper. · View Herald TranscriptFeb 12 2016, 5:51 PM

Hmm, it's at the very least faster than not debouncing (testing on the widgets demo, ~650 ms vs ~700 ms).

Change 270987 had a related patch set uploaded (by Bartosz Dziewoński):
OO.ui.debounce: If an immediate timeout is already waiting, don't re-set it

https://gerrit.wikimedia.org/r/270987

That doesn't seem to save us much (~630ms on widgets demo), but it makes me feel warm and fuzzy and will reduce the profiling noise ;)

matmarex claimed this task.Feb 16 2016, 4:41 PM
matmarex triaged this task as Medium priority.Feb 16 2016, 4:48 PM

Change 270987 merged by jenkins-bot:
OO.ui.debounce: If an immediate timeout is already waiting, don't re-set it

https://gerrit.wikimedia.org/r/270987

Jdforrester-WMF closed this task as Resolved.Feb 18 2016, 3:26 AM
Jdforrester-WMF set the point value for this task to 1.
Jdforrester-WMF edited projects, added OOjs-UI-next-release; removed Patch-For-Review.
Jdforrester-WMF set Security to None.