-
Notifications
You must be signed in to change notification settings - Fork 10
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 growth with parseString #46
Comments
thanks again for the feedback :) Yes, the usage of to your points:
|
Re 2... Essentially it has the same lump of CSS/LESS(?) repeating again and again in the cache file. I didn't study the structure explicitly, but try compiling some LESS with a few mixins, and then inspect $this->rules to see exactly what is there, I think you'll see. My cache file was around 7MB. |
I think actually the cache file size isn't related to the other slowness problem in #2. I think it's just currentFileInfo is being set throughout the node structure. I think you should at least consider passing this around and into structures as an explicit reference. I think right now it is literally copying the data when the cache is serialized. |
The cache system needs an update as you suggested in 1) and 2) thanks |
parseString uses a dummy last modified time, which is okay on face value because cache signatures are based on actual rules and contexts. However the last modified time exists through the rule tree, so leaks through to the cache signature. Hence every time parseString is used, there's a new cache file.
I tested changing to something constant and unique. I don't think uniqueness was actually required, as this isn't the cache signature, but doesn't hurt performance much. It's a hack though. Maybe null would have been better, but then it would likely need knock-on changes so that null was always properly handled as a valid value.
Oh and fix spelling of 'coming' too, lol.
In the process of writing this up, I double checked myself, and I'm despairing a bit for 2 reasons...
The text was updated successfully, but these errors were encountered: