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

Cache parsed properties, change provided properties to fields #8

Merged
merged 1 commit into from
Jul 26, 2020

Conversation

zanaptak
Copy link
Owner

@zanaptak zanaptak commented Jul 26, 2020

Introduce longer cache for file and process parsed results in addition to the shorter generated type cache.

Also change the provided type to use public literal fields instead of properties. This improves the performance of large IDE completion lists.

Below are informal timings on large sets of Tailwind CSS classes, from the moment of typing a dot on the type until the unfiltered completion list appearing, also compared to a module of hard-coded literals. Time in seconds on a desktop i7-4790k CPU.

Source Tailwind classes Visual Studio 2019 Visual Studio Code
TypedCssClasses 0.3.1 13851 2.1 3.3
TypedCssClasses 0.4.0 13851 1.2 2.2
hard-coded module 13851 0.7 1.7
TypedCssClasses 0.3.1 5535 1.1 1.8
TypedCssClasses 0.4.0 5535 0.7 1.3
hard-coded module 5535 0.4 1.2

Note: The lower Tailwind class count obtained by configuring 1 responsive screen breakpoint instead of the default of 4. See Tailwind CSS theme configuration.

Fixes #7.

@zanaptak zanaptak merged commit 41448dc into master Jul 26, 2020
@zanaptak zanaptak deleted the cache branch July 26, 2020 20:05
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 this pull request may close these issues.

Cache results of process execution
1 participant