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

about the performance of parse multifiles #3033

Closed
teazean opened this issue Feb 24, 2017 · 3 comments
Closed

about the performance of parse multifiles #3033

teazean opened this issue Feb 24, 2017 · 3 comments

Comments

@teazean
Copy link

teazean commented Feb 24, 2017

Sometimes we have a less library maybe called lib.less. and in other project (called A) we can use the lib.less as base-mixins, but when we compile the less files in A , we could have to parse the lib.less for many times according to the mount of less files in project A.

Is there any methods that we could cache the parsed result of lib.less, so we can prompt the performance of compiling less files.

I had tried to use vistors to modify the root object, but it seems to be too complicated.

@rjgotten
Copy link
Contributor

rjgotten commented Feb 27, 2017

Less already caches the parsed AST, keyed on the resolved URL of the file. (It can lead to some weird stuff on Windows with case-insensitive file names vs. case-sensitive cache keys, actually. Hehe. ^_^ )

What Less doesn't cache is the transformed output of those imported files, i.e. , their compile step. It cannot do that because of how the language scoping rules, execution order and features like dynamic imports (imports using variable replacer tokens) interplay in a way that the same file imported in different places could have a different compiled result because of other imports that preceeded it.

@seven-phases-max
Copy link
Member

I guess this can be closed as duplicate of #2640 (though it has "bug" label it's more an "implementation tips/tricks/details" discussion).

@seven-phases-max
Copy link
Member

Closing in favour of #2640.

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

No branches or pull requests

3 participants