Skip to content

Conversation

@KaelWD
Copy link
Member

@KaelWD KaelWD commented Mar 27, 2025

Computed refs that are infrequently accessed and don't do anything complex can be replaced with getter refs which saves the setup and caching overhead of computed.

time to render 1000x <v-btn icon="$vuetify" variant="flat" />:
dev: 182ms (189 180 162 176 202)
pr: 139ms (146 136 133 135 144)

Some of these changes might actually hurt performance but I'm not gonna microbenchmark every single one, overall it's a significant improvement.

@KaelWD KaelWD force-pushed the refactor/remove-computed branch from ea9439f to fec8132 Compare March 27, 2025 11:07
@KaelWD KaelWD changed the base branch from dev to master April 4, 2025 04:52
@KaelWD KaelWD marked this pull request as ready for review April 8, 2025 07:24
@MajesticPotatoe MajesticPotatoe added the T: enhancement Functionality that enhances existing features label Apr 8, 2025
@johnleider johnleider requested a review from a team April 13, 2025 02:42
Copy link
Member

@ikushum ikushum left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looking at the number of files changed, is it safe to merge this into master directly?

@johnleider
Copy link
Member

Where is your sense of adventure?

@ikushum
Copy link
Member

ikushum commented Apr 13, 2025

Where is your sense of adventure?

Just worried about a potential adventurous rollback later 😅

@KaelWD
Copy link
Member Author

KaelWD commented Apr 22, 2025

Should be fine, toRef() has the same behaviour as computed() just without caching.

@KaelWD KaelWD changed the title refactor: remove computed() refactor: replace computed() with toRef() Apr 22, 2025
@KaelWD KaelWD added this to the v3.8.x milestone Apr 22, 2025
@KaelWD KaelWD merged commit 9b07be9 into master Apr 22, 2025
18 checks passed
@KaelWD KaelWD deleted the refactor/remove-computed branch April 22, 2025 08:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

T: enhancement Functionality that enhances existing features

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants