Skip to content

[FrameworkBundle] Fallback to default cache system in production for validation #18544

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
Apr 15, 2016

Conversation

tgalopin
Copy link
Contributor

Q A
Branch? master
Bug fix? no
New feature? yes
BC breaks? no
Deprecations? no
Tests pass? WIP
Fixed tickets -
License MIT
Doc PR -

This PR proposes a default fallback to filesystem cache for some services if the APC cache is not enabled in production. In other words, if the following part of config_prod.yml file is not uncommented, the filesystem will be used:

#framework:
#    validation:
#        cache: validator.mapping.cache.doctrine.apc
#    serializer:
#        cache: serializer.mapping.cache.doctrine.apc
#
# ... other services

@tgalopin tgalopin force-pushed the cache-default branch 3 times, most recently from 015c3d0 to fa9c721 Compare April 14, 2016 12:30
@tgalopin tgalopin changed the title [WIP][FrameworkBundle] Fallback to default cache system in production for some services [FrameworkBundle] Fallback to default cache system in production for some services Apr 14, 2016
@tgalopin
Copy link
Contributor Author

Not WIP anymore. Targeting 3.1.

@tgalopin tgalopin changed the title [FrameworkBundle] Fallback to default cache system in production for some services [FrameworkBundle] Fallback to default cache system in production for validation Apr 14, 2016

foreach (array('name', 'root_dir', 'environment', 'debug') as $key) {
if ($container->hasParameter('kernel.'.$key)) {
$namespaceSuffix .= '.'.$container->getParameter('kernel.'.$key);
Copy link
Member

Choose a reason for hiding this comment

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

👍 for seeding cache pool namespaces with parameters from the kernel, this was missing

@nicolas-grekas
Copy link
Member

👍 for 3.1

@fabpot
Copy link
Member

fabpot commented Apr 15, 2016

Thank you @tgalopin.

@fabpot fabpot merged commit 1a65595 into symfony:master Apr 15, 2016
fabpot added a commit that referenced this pull request Apr 15, 2016
…production for validation (tgalopin)

This PR was merged into the 3.1-dev branch.

Discussion
----------

[FrameworkBundle] Fallback to default cache system in production for validation

| Q             | A
| ------------- | ---
| Branch?       | master
| Bug fix?      | no
| New feature?  | yes
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | WIP
| Fixed tickets | -
| License       | MIT
| Doc PR        | -

This PR proposes a default fallback to filesystem cache for some services if the APC cache is not enabled in production. In other words, if the following part of `config_prod.yml` file is not uncommented, the filesystem will be used:

``` yaml
#framework:
#    validation:
#        cache: validator.mapping.cache.doctrine.apc
#    serializer:
#        cache: serializer.mapping.cache.doctrine.apc
#
# ... other services
```

Commits
-------

1a65595 [FrameworkBundle] Fallback to default cache system in production for validation
nicolas-grekas added a commit that referenced this pull request Apr 19, 2016
…production for serializer (tgalopin)

This PR was merged into the 3.1-dev branch.

Discussion
----------

[FrameworkBundle] Fallback to default cache system in production for serializer

| Q             | A
| ------------- | ---
| Branch?       | master
| Bug fix?      | no
| New feature?  | yes
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | yes
| Fixed tickets | -
| License       | MIT
| Doc PR        | -

In the same idea as #18544, this PR proposes a default fallback to filesystem cache for the serializer if the APC cache is not enabled in production. In other words, if the following part of `config_prod.yml` file is not uncommented, the filesystem will be used:

``` yaml
#framework:
#    serializer:
#        cache: serializer.mapping.cache.doctrine.apc
```

Commits
-------

4f0b8be [FrameworkBundle] Fallback to default cache system in production for serializer
symfony-splitter pushed a commit to symfony/framework-bundle that referenced this pull request Apr 19, 2016
…production for serializer (tgalopin)

This PR was merged into the 3.1-dev branch.

Discussion
----------

[FrameworkBundle] Fallback to default cache system in production for serializer

| Q             | A
| ------------- | ---
| Branch?       | master
| Bug fix?      | no
| New feature?  | yes
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | yes
| Fixed tickets | -
| License       | MIT
| Doc PR        | -

In the same idea as symfony/symfony#18544, this PR proposes a default fallback to filesystem cache for the serializer if the APC cache is not enabled in production. In other words, if the following part of `config_prod.yml` file is not uncommented, the filesystem will be used:

``` yaml
#framework:
#    serializer:
#        cache: serializer.mapping.cache.doctrine.apc
```

Commits
-------

4f0b8be [FrameworkBundle] Fallback to default cache system in production for serializer
@fabpot fabpot mentioned this pull request May 13, 2016
@tgalopin tgalopin deleted the cache-default branch July 29, 2016 15:56
fabpot added a commit that referenced this pull request Sep 14, 2016
…or based on PhpArrayAdapter (tgalopin)

This PR was merged into the 3.2-dev branch.

Discussion
----------

[FrameworkBundle] Introduce a cache warmer for Validator based on PhpArrayAdapter

| Q             | A
| ------------- | ---
| Branch?       | master
| Bug fix?      | no
| New feature?  | yes
| BC breaks?    | no
| Deprecations? | yes
| Tests pass?   | -
| Fixed tickets | -
| License       | MIT
| Doc PR        | -

Following the cache warmer for annotations PR (#18533), this PR introduces a cache warmer for YAML and XML Validator configuration.

Based on the PhpArrayAdapter, it uses the naming conventions (`Resources/config/validation`) to find the files and compile them into a single PHP file stored in the cache directory. This file uses shared memory on PHP 7.

The benefit of this PR are the same than the ones of the annotations PR:

- validation configuration can be warmed up offline
- on PHP 7, there is no need for user extension to get maximum performances (ie. if you use this PR and the other one, you probably won't need to enable APCu to have great performances)
- on PHP 7 again, we are not sensitive to APCu memory fragmentation
- last but not least, global performance is slightly better (I get 30us per class gain in Blackfire)

This PR also deprecates the framework.validator.cache key in favor of the cache pool introduced in #18544.

Commits
-------

6bdaf0b [FrameworkBundle] Introduce a cache warmer for Validator based on PhpArrayAdapter
symfony-splitter pushed a commit to symfony/validator that referenced this pull request Sep 14, 2016
…or based on PhpArrayAdapter (tgalopin)

This PR was merged into the 3.2-dev branch.

Discussion
----------

[FrameworkBundle] Introduce a cache warmer for Validator based on PhpArrayAdapter

| Q             | A
| ------------- | ---
| Branch?       | master
| Bug fix?      | no
| New feature?  | yes
| BC breaks?    | no
| Deprecations? | yes
| Tests pass?   | -
| Fixed tickets | -
| License       | MIT
| Doc PR        | -

Following the cache warmer for annotations PR (symfony/symfony#18533), this PR introduces a cache warmer for YAML and XML Validator configuration.

Based on the PhpArrayAdapter, it uses the naming conventions (`Resources/config/validation`) to find the files and compile them into a single PHP file stored in the cache directory. This file uses shared memory on PHP 7.

The benefit of this PR are the same than the ones of the annotations PR:

- validation configuration can be warmed up offline
- on PHP 7, there is no need for user extension to get maximum performances (ie. if you use this PR and the other one, you probably won't need to enable APCu to have great performances)
- on PHP 7 again, we are not sensitive to APCu memory fragmentation
- last but not least, global performance is slightly better (I get 30us per class gain in Blackfire)

This PR also deprecates the framework.validator.cache key in favor of the cache pool introduced in symfony/symfony#18544.

Commits
-------

6bdaf0b [FrameworkBundle] Introduce a cache warmer for Validator based on PhpArrayAdapter
symfony-splitter pushed a commit to symfony/framework-bundle that referenced this pull request Sep 14, 2016
…or based on PhpArrayAdapter (tgalopin)

This PR was merged into the 3.2-dev branch.

Discussion
----------

[FrameworkBundle] Introduce a cache warmer for Validator based on PhpArrayAdapter

| Q             | A
| ------------- | ---
| Branch?       | master
| Bug fix?      | no
| New feature?  | yes
| BC breaks?    | no
| Deprecations? | yes
| Tests pass?   | -
| Fixed tickets | -
| License       | MIT
| Doc PR        | -

Following the cache warmer for annotations PR (symfony/symfony#18533), this PR introduces a cache warmer for YAML and XML Validator configuration.

Based on the PhpArrayAdapter, it uses the naming conventions (`Resources/config/validation`) to find the files and compile them into a single PHP file stored in the cache directory. This file uses shared memory on PHP 7.

The benefit of this PR are the same than the ones of the annotations PR:

- validation configuration can be warmed up offline
- on PHP 7, there is no need for user extension to get maximum performances (ie. if you use this PR and the other one, you probably won't need to enable APCu to have great performances)
- on PHP 7 again, we are not sensitive to APCu memory fragmentation
- last but not least, global performance is slightly better (I get 30us per class gain in Blackfire)

This PR also deprecates the framework.validator.cache key in favor of the cache pool introduced in symfony/symfony#18544.

Commits
-------

6bdaf0b [FrameworkBundle] Introduce a cache warmer for Validator based on PhpArrayAdapter
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