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

Changed service causes dependency checks on every request #144

Closed
fmasa opened this issue Feb 21, 2017 · 3 comments
Closed

Changed service causes dependency checks on every request #144

fmasa opened this issue Feb 21, 2017 · 3 comments

Comments

@fmasa
Copy link

@fmasa fmasa commented Feb 21, 2017

There is a problem with current DIC expiration check.

Cosider following config:

services:
- MyService

Let's say I change content of MyService.php from

<?php
class MyService {}

to

<?php
class MyService
{
    public function foo();
}

(file changed, dependencies didn't)

On next request DependencyChecker compares modification times with meta file of generated container, which differs. Dependency hash is now calculated and matches the one in meta file, so container is considered non-expired.

The problem is that meta file is not updated and hash is calculated on every request, which leads to performance overhead for large containers.

@fmasa fmasa changed the title Changed service causes dependency checks Changed service causes dependency checks on every request Feb 21, 2017
@TomasVotruba

This comment has been minimized.

Copy link
Contributor

@TomasVotruba TomasVotruba commented Feb 21, 2017

Hi, could you send simple failing test please?

@dg dg closed this in 08c6242 Feb 27, 2017
dg added a commit that referenced this issue Feb 27, 2017
dg added a commit that referenced this issue Feb 27, 2017
@TomasVotruba

This comment has been minimized.

Copy link
Contributor

@TomasVotruba TomasVotruba commented Feb 27, 2017

Thank you @dg !

@fmasa

This comment has been minimized.

Copy link
Author

@fmasa fmasa commented Feb 27, 2017

Thanks :) @dg

dg added a commit that referenced this issue Feb 27, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
2 participants
You can’t perform that action at this time.