-
Notifications
You must be signed in to change notification settings - Fork 463
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
Does LibSASS have a precompiled partials cache? #2879
Comments
This is not something we have plans to do at this time. |
Could you please share your thoughts about this? In my opinion, we can at least cache partials on a per-bundle basis (by using custom imports and render callback), eliminating disk IO and redundant bundle recompilations. Is this the edge of what's possible at the moment or is there some other improvement I'm missing? |
I don't think this is feasible or that it would bring much performance improvement. We could write the parsed AST tree to disk and load that instead of the actual scss file in case it hasn't changed. But in comparison to the expand and eval stage, the parsing does not really take that much time. E.g. a huge scss file with just nesting (very simple to expand) still only takes up to 25% of the total time. Given the overhead of adding the changed check and parsing the "read-optimized" ast node tree from disk, I would guess that a maximum 10% improvement could be achieved by adding some caching here. One could think about caching already fully evaluated trees, but that is not easy given to dynamic nature of the sass language, e.g. I will close this as it is very low priority, but added it to the wish-lish ticket instead. |
Marcel, thank you for detailed explanation. Very instructive and helpful! |
It's not in the Ruby gem and it's also not in libsass. See: sass/libsass#2879
It's not in the Ruby gem and it's also not in libsass. See: sass/libsass#2879
It's not in the Ruby gem and it's also not in libsass. See: sass/libsass#2879
It's not in the Ruby gem and it's also not in libsass. See: sass/libsass#2879
This is not a bug, but rather a potential feature request. I haven’t found any information highlighting how LibSass caching works, so opening this ticket to clarify things.
I’ve also posted same ticket at DartSASS.
In Browserify we have caching mechanism, which stores pre-compiled partials. This notably shortens repeated processing times by eliminating FS/IO, parsing, transformation and sourcemaps generation.
In SASS, however, it’s more complex, since precompiled partials should also contain transpile-time context such as variables, mixins and functions.
Do you think it’s possible to cache precompiled partials? If no, can we at least cache pre-parsed partials?
I’ve done NodeSASS vs DartSASS performance comparison. Here is what I’ve found:
I’ve seen this feature merged into DartSASS, stating it’ll allow to cache imports across compilations. Wondering if it's deployed and can be used.
In general, LibSASS and DartSASS are both fast, but still there is a room for improvement. What do you think?
The text was updated successfully, but these errors were encountered: