perf: faster styler mixins #43
No reviewers
Labels
No labels
bug
documentation
duplicate
enhancement
good first issue
help wanted
invalid
question
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
mupen64/ugui!43
Loading…
Reference in a new issue
No description provided.
Delete branch "fast-styler-mixins"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Optimizes styler mixins so that they don't clone the entire styler when used.
Also adds styler mixin usage to the
stress_testdemo alongside a frametime counter.Pull request overview
Optimizes per-control
styler_mixinapplication by avoiding cloning the full styler params table each time a mixin is used, and adds demo instrumentation/examples to validate the improvement.Changes:
ugui.internal.deep_mergeto apply overrides in-place and return a rollback function.apply_styler_mixinto use the new in-place merge + rollback instead of cloningugui.standard_styler.params.styler_mixinexample in the stress test and added a frametime overlay to the base demo.Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 2 comments.
styler_mixinexample to exercise the new path during the stress test.💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
@ -274,35 +274,36 @@ ugui.internal = {return resRollback closures capture the loop variable
keyby reference. After thepairs()loop advances, all stored rollback functions may end up writing to the lastkey, so rollback can corruptbinstead of restoring it. Capturekeyin a new local (e.g.,local k = key) when creating the rollback op (or store{t2, key, prev}tuples and apply them in rollback).This change alters how
styler_mixinis applied/reverted (in-place mutation + rollback) and is easy to regress (especially for nested tables / numeric keys). There don't appear to be any tests coveringcontrol.styler_mixinbehavior; please add a unit test that asserts (1) params are overridden during draw and (2) restored afterward.