This repository was archived by the owner on Dec 5, 2019. It is now read-only.
Optimize cache generation speed and footprint#368
Open
Cerdic wants to merge 18 commits intooyejorge:masterfrom
Open
Optimize cache generation speed and footprint#368Cerdic wants to merge 18 commits intooyejorge:masterfrom
Cerdic wants to merge 18 commits intooyejorge:masterfrom
Conversation
…n clearly be a static information we dont need to store so multiple times in cache, involving so many exports as string
…ic Less_Environment::$currentFileInfo
…c Less_Environment::$currentFileInfo
… static Less_Environment::$currentFileInfo
…c Less_Environment::$currentFileInfo
… static Less_Environment::$currentFileInfo
…ic Less_Environment::$currentFileInfo
…ss_Environment::$currentFileInfo
…tic Less_Environment::$currentFileInfo
… Less_Environment::$currentFileInfo
…ess_Environment::$currentFileInfo
…atic Less_Environment::$currentFileInfo
…Less_Environment::$currentFileInfo
…tic Less_Environment::$currentFileInfo
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
A bottleneck in cache generation is the computation of
cache_stringdue to the number of arguments needed to be exported. Examining cache I saw that$currentFileInfois over and over repeated in the cache.This pull request change the
$currentFileInfoproperty from Less_Environment in a static property being used globally in allLess/Tree/xxxinstead of duplicating the same property value everywhere.The static property is poped and pulled before and after each inclusion, that was already done.
*
Tree/Comment,Tree/Directive,Tree/Mixin/CallandTree/Selectorare keeping a copy of the reference flag of$currentFileInfoTree/Urlis keeping a copy ofuri_rootTree/Importis keeping a full copy of$currentFileInfoThus the cache footprint is divided by 8 on a real case life (of course depending of the
currentFileInfocontent) and the time consumption for generatingcache_stringproperty is also reduced