Skip to content

[PropertyAccess] Use ArrayAdapter in debug mode #21936

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

Merged
merged 1 commit into from
Mar 9, 2017

Conversation

chalasr
Copy link
Member

@chalasr chalasr commented Mar 8, 2017

Q A
Branch? 3.2
Bug fix? yes
New feature? no
BC breaks? no
Deprecations? no
Tests pass? yes
Fixed tickets #21894
License MIT
Doc PR n/a

https://github.com/symfony/symfony/pull/21936/files?w=1

@chalasr chalasr force-pushed the propertyaccessor-dev-cache branch 6 times, most recently from 58cfdfd to fed148b Compare March 8, 2017 21:03
Copy link
Member

@nicolas-grekas nicolas-grekas left a comment

Choose a reason for hiding this comment

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

👍 ping @dunglas

@@ -1254,16 +1255,24 @@ private function registerCacheConfiguration(array $config, ContainerBuilder $con
}

if (method_exists(PropertyAccessor::class, 'createCache')) {
$propertyAccessDefinition = $container->register('cache.property_access', AdapterInterface::class);
$propertyAccessDefinition = $container->register('cache.property_access');
Copy link
Member

Choose a reason for hiding this comment

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

keep this line

@chalasr chalasr force-pushed the propertyaccessor-dev-cache branch from fed148b to e6a6de4 Compare March 9, 2017 07:34
$propertyAccessDefinition->setArguments(array(null, null, $version, new Reference('logger', ContainerInterface::IGNORE_ON_INVALID_REFERENCE)));
} else {
$propertyAccessDefinition->setClass(ArrayAdapter::class);
$propertyAccessDefinition->setArguments(array(0));
Copy link
Member

Choose a reason for hiding this comment

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

why this line?

Copy link
Member

Choose a reason for hiding this comment

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

in fact, can't you add false as second arg? (to store unserialized)

Copy link
Member

Choose a reason for hiding this comment

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

in fact, can't we add false as second arg? (to store unserialized)

Copy link
Member Author

Choose a reason for hiding this comment

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

Removing this line gives:

Symfony\Component\DependencyInjection\Exception\OutOfBoundsException: Cannot replace arguments if none have been configured yet.

symfony/symfony/src/Symfony/Bundle/FrameworkBundle/DependencyInjection/Compiler/CachePoolPass.php:74

CachePoolPass.php:74 tries to replace arguments that are not set yet, for ArrayAdapter at least. Should it be fixed?

Copy link
Member Author

Choose a reason for hiding this comment

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

false added as 2nd arg, works as well

Copy link
Member

Choose a reason for hiding this comment

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

In fact, the ArrayAdapter should not have the cache.pool tag!

Copy link
Member Author

Choose a reason for hiding this comment

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

indeed, fixed

@chalasr chalasr force-pushed the propertyaccessor-dev-cache branch 3 times, most recently from 3def569 to 63f5e75 Compare March 9, 2017 08:53
@chalasr chalasr force-pushed the propertyaccessor-dev-cache branch from 63f5e75 to dca3f36 Compare March 9, 2017 09:04
Copy link
Member

@nicolas-grekas nicolas-grekas left a comment

Choose a reason for hiding this comment

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

👍

@nicolas-grekas nicolas-grekas added this to the 3.2 milestone Mar 9, 2017
Copy link
Member

@xabbuh xabbuh left a comment

Choose a reason for hiding this comment

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

👍

@nicolas-grekas
Copy link
Member

Thank you @chalasr.

@nicolas-grekas nicolas-grekas merged commit dca3f36 into symfony:3.2 Mar 9, 2017
nicolas-grekas added a commit that referenced this pull request Mar 9, 2017
This PR was merged into the 3.2 branch.

Discussion
----------

[PropertyAccess] Use ArrayAdapter in debug mode

| Q             | A
| ------------- | ---
| Branch?       | 3.2
| Bug fix?      | yes
| New feature?  | no
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | yes
| Fixed tickets | #21894
| License       | MIT
| Doc PR        | n/a

https://github.com/symfony/symfony/pull/21936/files?w=1

Commits
-------

dca3f36 [PropertyAccess] Use ArrayAdapter in debug mode
@chalasr chalasr deleted the propertyaccessor-dev-cache branch March 9, 2017 10:24
@fabpot fabpot mentioned this pull request Mar 10, 2017
@teohhanhui
Copy link
Contributor

Was there any profiling done to assess the performance impact of this change? (As opposed to stale checking.)

@nicolas-grekas
Copy link
Member

Are you experiencing any issue? Please open new ticket, comments on closed can't be tracked.

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.

5 participants