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 1 commit into
base: master
from

Conversation

Projects
None yet
2 participants
@falkenhawk
Copy link

commented May 31, 2019

  • 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]

Optimize compiled string definitions
 - run preg_replace_callback already during compilation
@mnapoli

mnapoli approved these changes Jun 1, 2019

Copy link
Member

left a comment

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
You can’t perform that action at this time.