Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Optimize compiled string definitions #663

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

Conversation

falkenhawk
Copy link
Contributor

  • run preg_replace_callback already during compilation

from:

    protected function get5ce3da5dc66c0791095127()
    {
        return \DI\Definition\StringDefinition::resolveExpression('path.cache', '{BASE_PATH}/application/cache', $this->delegateContainer);
    }

    protected function get5ce3da5dc66c3314070297()
    {
        return \DI\Definition\StringDefinition::resolveExpression('path.cache.app', '{path.cache}/file', $this->delegateContainer);
    }

to:

    protected function get5ce3da5dc66c0791095127()
    {
        return ''.$this->resolveStringPlaceholder('BASE_PATH', 'path.cache').'/application/cache';
    }

    protected function get5ce3da5dc66c3314070297()
    {
        return ''.$this->resolveStringPlaceholder('path.cache', 'path.cache.app').'/file';
    }

where resolveStringPlaceholder proxies to $this->delegateContainer->get()

[from ovos#5]

 - run preg_replace_callback already during compilation
Copy link
Member

@mnapoli mnapoli left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Awesome, I'll merge when I've done performance tests so that I can detail the performance improvement in the release notes and announcement.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants