Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

perf: reduce cookies widget reactivity #2550

Draft
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

rwd
Copy link
Contributor

@rwd rwd commented Jan 29, 2025

Vue data and computed properties are reactive, whereas those set on the vm in created (without being declared in data) are static.

Utilise this to reduce the reactivity of the properties in cookies/service management components and the klaro mixin where they don't need to be reactive, reducing main thread work and event duration e.g. when opening the cookies widget modal.

Measurable using dev tools, performance tab, start a recording, open the cookies widget modal, stop the recording, observe the click event duration. Compare to duration without the reactivity reduction. Reduction from ~ 42 ms to ~ 26 ms observed.

Copy link

Preview deployment: https://pr-2550.portal-js.dev.eanadev.org/

@rwd rwd changed the title pref: reduce cookies widget reactivity perf: reduce cookies widget reactivity Jan 29, 2025
@rwd
Copy link
Contributor Author

rwd commented Jan 29, 2025

After further testing, improvement to event time is not evident for others.

@rwd rwd marked this pull request as draft January 29, 2025 12:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant