Skip to content
This repository has been archived by the owner on Dec 5, 2019. It is now read-only.

Optimize cache generation speed and footprint #368

Open
wants to merge 18 commits into
base: master
Choose a base branch
from

Conversation

Cerdic
Copy link

@Cerdic Cerdic commented Oct 16, 2018

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

Cerdic added 18 commits October 16, 2018 22:21
…n clearly be a static information we dont need to store so multiple times in cache, involving so many exports as string
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant