8000 Ticket 25999 by dmifedorenko · Pull Request #26013 · symfony/symfony · GitHub
[go: up one dir, main page]

Skip to content

Ticket 25999 #26013

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

Closed
wants to merge 3 commits into from
Closed

Ticket 25999 #26013

wants to merge 3 commits into from

Conversation

dmifedorenko
Copy link
Contributor
@dmifedorenko dmifedorenko commented Feb 2, 2018
Q A
Branch? 3.4
Bug fix? yes
New feature? no
BC breaks? no
Deprecations? no
Tests pass? yes
Fixed tickets #25999
License MIT

Copy link
Contributor
@linaori linaori left a comment

Choose a reason for hiding this comment

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

To fix the changes in a lower branch, you'll have to make different pull requests. Find the lowest maintained branch (2.7 in this case) that supports your patch for those lines and base the pull request on that branch. You mentioned that the ReflectionClassResource does not exist in 2.7 yet, so those changes need to be applied in a higher branch than 2.7 (meaning multiple pull requests).

* 3.4.x (2018-xx-xx)

* bug #25999 [DependencyInjection] Huge performance degradation of ReflectionClassResource and FileResource on big projects inside Docker For Mac

Copy link
Contributor

Choose a reason for hiding this comment

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

This file is updated automatically when a new symfony version is released. Can you please revert this change?

return file_exists($this->resource) && @filemtime($this->resource) <= $timestamp;
$filemtime = @filemtime($this->resource);

return $filemtime && $filemtime <= $timestamp;
Copy link
Contributor

Choose a reason for hiding this comment

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

These changes can probably be fixed in a lower branch.

Copy link
Contributor
@sroze sroze Feb 2, 2018

Choose a reason for hiding this comment

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

You can probably inline the definition as well, i.e.

return false !== ($filemtime = @filemtime($this->resource)) && $filemtime <= $timestamp;

@@ -34,12 +34,13 @@ public function __construct($class, $path, array $autowiringMetadata)

public function isFresh($timestamp)
{
if (!file_exists($this->filePath)) {
$filemtime = @filemtime($this->filePath);
if (!$filemtime) {
Copy link
Contributor

Choose a reason for hiding this comment

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

The changes in this file can probably also be applied on a lower branch.

Copy link
Contributor

Choose a reason for hiding this comment

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

same as @sroze you can inline all this condition

return file_exists($this->resource) && @filemtime($this->resource) <= $timestamp;
$filemtime = @filemtime($this->resource);

return $filemtime && $filemtime <= $timestamp;
Copy link
Contributor
@sroze sroze Feb 2, 2018

Choose a reason for hiding this comment

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

You can probably inline the definition as well, i.e.

return false !== ($filemtime = @filemtime($this->resource)) && $filemtime <= $timestamp;

@@ -37,11 +37,12 @@ public function isFresh($timestamp)
}

foreach ($this->files as $file => $v) {
if (!file_exists($file)) {
$filemtime = @filemtime($file);
if (!$filemtime) {
Copy link
Contributor

Choose a reason for hiding this comment

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

inline?

if (false === ($filemtime = @filemtime($file))) {

@sroze
Copy link
Contributor
sroze commented Feb 2, 2018

Also, it would be good to give the pull-request a nice title, such as "Only using filemtime to check file freshness" or something like that; this will help everybody to know roughly what this pull-request is about without looking at the code change.

@Simperfit
Copy link
Contributor

Travis failure seems unrelated to the changes

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.

7 participants
0