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

Improve @apply performance #3718

Merged
merged 2 commits into from Apr 30, 2021

Conversation

@axelhzf
Copy link
Contributor

@axelhzf axelhzf commented Mar 9, 2021

Fix #3717

This is an attempt to improve the performance of using @apply.

As you can see on this profile, a lot of time is wasted on the buildUtilityMap function.

Captura de pantalla 2021-03-09 a las 13 49 04

This PR tries to reduce the work done by this function by memoizing the static part

You can see the difference with this profile (with this patch applied)

Captura de pantalla 2021-03-09 a las 14 36 31

@adamwathan
Copy link
Contributor

@adamwathan adamwathan commented Mar 27, 2021

Haven't had a chance to look at this in depth yet but just wanted to follow up anyways and say thank you! We don't get PRs that touch stuff this deep very often so I really appreciate you digging in 🙏 Will get to this soon!

@adamwathan adamwathan force-pushed the tailwindlabs:master branch from c681549 to 23b71a9 Apr 23, 2021
@adamwathan adamwathan merged commit fbc0f2f into tailwindlabs:master Apr 30, 2021
2 checks passed
2 checks passed
@github-actions
build (12.x)
Details
@github-actions
build (14.x)
Details
@adamwathan
Copy link
Contributor

@adamwathan adamwathan commented Apr 30, 2021

Thanks for this, will try to get it out in a patch soon!

adamwathan added a commit that referenced this pull request May 7, 2021
* Split the buildUtilityMap function to memoize the static part

* fix tests
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Linked issues

Successfully merging this pull request may close these issues.

2 participants