This repository has been archived by the owner on Dec 5, 2019. It is now read-only.
forked from wikimedia/less.php
-
Notifications
You must be signed in to change notification settings - Fork 2
Optimize cache generation speed and footprint #368
Open
Cerdic
wants to merge
18
commits into
oyejorge:master
Choose a base branch
from
Cerdic:opt/perf1
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Conversation
This file contains 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
…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
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_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