Skip to content

Performance problem with @apply #3717

Closed
@axelhzf

Description

@axelhzf

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions