perf(core): filter rulesDynamic
in resolveConfig
#1534
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Changes to
@unocss/core
rulesDynamic
is being filtered and reversed inresolveConfig
, this yields a ~10ms improvement on the new benchmark.extractorSplit
now first de-dupe via set then test the string. The impact is minimal, but faster on dedicated benchmark.forEach
. The impact is again minimal, but it's nice to have.Changes to the benchmark
buildStart
tocloseBundle
, instead ofbuildEnd
.The old benchmark is... flawed at best.
Since both TailwindCSS and WindiCSS generate their CSS before
buildEnd
, and UnoCSS generates it's CSS ingenerateBundle
which is afterbuildEnd
. The benchmark doesn't actually measure the full build time for UnoCSS, but only part of the extraction time.To make the benchmark result more realistic, and better for future comparisons, the new one measures the full build time, which now includes CSS generation time.