A bottleneck in cache generation is the computation of cache_string due to the number of arguments needed to be exported. Examining cache I saw that $currentFileInfo is over and over repeated in the cache.
This pull request change the $currentFileInfo property from Less_Environment in a static property being used globally in all Less/Tree/xxx instead 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/Call and Tree/Selector are keeping a copy of the reference flag of $currentFileInfo
Tree/Url is keeping a copy of uri_root
only Tree/Import is keeping a full copy of $currentFileInfo
Thus the cache footprint is divided by 8 on a real case life (of course depending of the currentFileInfo content) and the time consumption for generating cache_string property is also reduced
A bottleneck in cache generation is the computation of
cache_string
due to the number of arguments needed to be exported. Examining cache I saw that$currentFileInfo
is over and over repeated in the cache.This pull request change the
$currentFileInfo
property from Less_Environment in a static property being used globally in allLess/Tree/xxx
instead 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/Call
andTree/Selector
are keeping a copy of the reference flag of$currentFileInfo
Tree/Url
is keeping a copy ofuri_root
Tree/Import
is keeping a full copy of$currentFileInfo
Thus the cache footprint is divided by 8 on a real case life (of course depending of the
currentFileInfo
content) and the time consumption for generatingcache_string
property is also reduced