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

Precompute common values for same files in different rules #89

Open
mondeja opened this issue Aug 7, 2023 · 2 comments
Open

Precompute common values for same files in different rules #89

mondeja opened this issue Aug 7, 2023 · 2 comments

Comments

@mondeja
Copy link
Member

mondeja commented Aug 7, 2023

I've just implemented a cache in simple-icons SVG linting rules to avoid parsing the same data for the same files over and over again (see simple-icons/simple-icons#9233) which gives a great performance improvement.

As this case is very common due the fact that SVGLint executes all function rules for the same set of files I think that could be added to the configuration by some hook or something like that. The implementation could be a function executed for each file before rules and some API added to function rules arguments to obtain the values.

Some thoughs about this?

@ericcornelissen
Copy link
Contributor

I think this makes sense, I would not be entirely sure what this would look like in the API though 🤔 Do you have something in mind @mondeja, or do you know of some examples from other tooling?

Also, would you be interested in working on this? If so I can assign the issue to you and I'd be happy to review your work.

@mondeja
Copy link
Member Author

mondeja commented Sep 1, 2023

I'll try to find other tools with this pattern before design the API, as I don't remember myself now see it ever 🤔 In that case I'll implement it, for sure.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants