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

Performance problem with @apply #3717

Closed
axelhzf opened this issue Mar 9, 2021 · 1 comment · Fixed by #3718
Closed

Performance problem with @apply #3717

axelhzf opened this issue Mar 9, 2021 · 1 comment · Fixed by #3718

Comments

@axelhzf
Copy link
Contributor

axelhzf commented Mar 9, 2021

Describe the problem:

After upgrading from tailwind 1.x to 2.x in a project (a nuxt application), our dev server starting times went from ~0.50s to ~1.3s. After some research, we found that the problems are vue components using @apply.

Our profiling looks like this

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

Most of the time is spent on the buildUtilityMap function. It's taking more than 100ms per component.
After analyzing the function, it looks like it does two things:

  • Generate the utilityMap for the lookupTree
  • Generate the utilityMap for the css defined by the component

I think we could follow the same approach used on #3032 and memoize the part of the function that won't change over time (the utilityMap for the lookupTree)

I will try to create a PR

@billrobclark
Copy link

Yo

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 a pull request may close this issue.

2 participants