Skip to content

vfsStreamDirectory::getChild() has absurd complexity #256

@mvorisek

Description

@mvorisek

image

captured when the PrestaShop/Smarty caching is conigured to VFS like:

use org\bovigo\vfs\vfsStream;

$vfsSmartyRoot = vfsStream::setup('smarty', 0000);
$vfsSmartyCompile = vfsStream::newDirectory('compile')->at($vfsSmartyRoot);
$vfsSmartyCache = vfsStream::newDirectory('cache')->at($vfsSmartyRoot);

global $smarty;
$smarty = new SmartyCustom();
$smarty->setConfigDir([]);
$smarty->setCompileDir($vfsSmartyCompile->url());
$smarty->setCacheDir($vfsSmartyCache->url());

in https://github.com/PrestaShop/PrestaShop/blob/1.7.7.4/config/smarty.config.inc.php#L37

and basic page like /index.php is opened.

I belive there is some exponential complexity when traversing directories with depth like 10 as xdebug profiler shows for 2181 calls of getContent getChild is executed more than million times.

Callers:

image


image

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions