This repository has been archived on 2023-08-20. You can view files and clone it, but cannot push or open issues or pull requests.
Go to file
Fabien Potencier 833b944548 merged branch mazen/optional-optimization (PR #5340)
Commits
-------

e271b17 Remove the string optimization since it causes no real performance gain but increases generation time of the dumped PHP Container

Discussion
----------

PhpDumper and large strings

When the PhpDumper is dealing with longer strings, the regular expression performed to optimize this can be quite a performance hog.
In our case sometimes the dumper takes more then 30 seconds if leaving this enabled. Disabling it will bring it back to sub-second speed.

This patch makes the optimization optional by passing in an additional container option.

---------------------------------------------------------------------------

by fabpot at 2012-08-25T16:57:29Z

I don't like adding yet another option for something that should "just works". It would be better to find a better way to optimise the strings for all cases.

---------------------------------------------------------------------------

by mazen at 2012-08-25T17:22:07Z

I never really tested how much of a runtime difference it incurs when either using the "optimized" version or the non optimized version, so:

Having an example at hand which generates stable results yields (in a non-debug environment with a booted container using either of the optimization methods):

Without optimized strings:

```
Time taken for tests:   14.865 seconds
Complete requests:      1000
Failed requests:        0
Write errors:           0
Total transferred:      217000 bytes
HTML transferred:       8000 bytes
Requests per second:    67.27 [#/sec] (mean)
Time per request:       14.865 [ms] (mean)
Time per request:       14.865 [ms] (mean, across all concurrent requests)
Transfer rate:          14.26 [Kbytes/sec] received

Connection Times (ms)
              min  mean[+/-sd] median   max
Connect:        0    0   0.0      0       0
Processing:    14   15  19.7     14     632
Waiting:       14   15  19.7     14     632
Total:         14   15  19.7     14     632

Percentage of the requests served within a certain time (ms)
  50%     14
  66%     14
  75%     14
  80%     14
  90%     14
  95%     14
  98%     15
  99%     23
 100%    632 (longest request)
```

With Optimized Strings enabled

```
Time taken for tests:   14.077 seconds
Complete requests:      1000
Failed requests:        0
Write errors:           0
Total transferred:      217000 bytes
HTML transferred:       8000 bytes
Requests per second:    71.04 [#/sec] (mean)
Time per request:       14.077 [ms] (mean)
Time per request:       14.077 [ms] (mean, across all concurrent requests)
Transfer rate:          15.05 [Kbytes/sec] received

Connection Times (ms)
              min  mean[+/-sd] median   max
Connect:        0    0   0.0      0       0
Processing:    14   14   1.3     14      48
Waiting:       14   14   1.3     14      48
Total:         14   14   1.3     14      48

Percentage of the requests served within a certain time (ms)
  50%     14
  66%     14
  75%     14
  80%     14
  90%     14
  95%     14
  98%     14
  99%     15
 100%     48 (longest request)
```

So the response times differ by around 0.8ms

Building the non-optimized container takes around 800ms
Building the optimized container takes 43 seconds

From my Point of View it would just be viable to remove the optimization (since it already incurred some issues fixed in 808088a3ca).

I do not see a way how to improve the regexps (but by all means I'm no regular expression guru)

---------------------------------------------------------------------------

by fabpot at 2012-08-30T07:12:55Z

I'm also for removing these optimizations. What others think?

---------------------------------------------------------------------------

by Baachi at 2012-08-30T07:54:53Z

I'm +1 for removing this feature.
The performance boost is to small.
2012-09-18 19:25:25 +02:00
src/Symfony merged branch mazen/optional-optimization (PR #5340) 2012-09-18 19:25:25 +02:00
.editorconfig Add EditorConfig File 2012-06-16 14:08:15 +02:00
.gitignore ignore composer.phar 2012-04-20 14:10:06 +01:00
.travis.yml [Locale] don't create a "current" directory anymore, uses only the ICU version as the name of the data directory 2012-08-07 12:17:02 -03:00
autoload.php.dist Removed the unnecessary file include 2012-08-31 13:16:54 +02:00
CHANGELOG-2.0.md updated CHANGELOG for 2.0.17 2012-08-28 09:03:49 +02:00
CHANGELOG-2.1.md updated CHANGELOG for 2.1.1 2012-09-11 06:59:00 +02:00
composer.json merged 2.1 2012-09-13 08:13:00 +02:00
CONTRIBUTING.md Create CONTRIBUTING.md file for auto-linking in PR's 2012-09-17 14:40:53 -04:00
CONTRIBUTORS.md update CONTRIBUTORS for 2.0.14 2012-05-17 18:30:22 +02:00
LICENSE Updated LICENSE files copyright 2012-02-22 10:10:37 +01:00
phpunit.xml.dist Set init.default_locale to 'en' in phpunit.xml.dist 2012-05-11 09:33:42 +02:00
README.md Point to information on how to run the test suite. (closes #5405) 2012-09-01 08:52:18 +02:00
UPGRADE-2.1.md Remove "you" word. 2012-09-04 12:35:57 +03:00

README

Build Status

What is Symfony2?

Symfony2 is a PHP 5.3 full-stack web framework. It is written with speed and flexibility in mind. It allows developers to build better and easy to maintain websites with PHP.

Symfony can be used to develop all kind of websites, from your personal blog to high traffic ones like Dailymotion or Yahoo! Answers.

Requirements

Symfony2 is only supported on PHP 5.3.3 and up.

Be warned that PHP versions before 5.3.8 are known to be buggy and might not work for you:

Installation

The best way to install Symfony2 is to download the Symfony Standard Edition available at http://symfony.com/download.

Documentation

The "Quick Tour" tutorial gives you a first feeling of the framework. If, like us, you think that Symfony2 can help speed up your development and take the quality of your work to the next level, read the official Symfony2 documentation.

Contributing

Symfony2 is an open source, community-driven project. If you'd like to contribute, please read the Contributing Code part of the documentation. If you're submitting a pull request, please follow the guidelines in the Submitting a Patch section.

Running Symfony2 Tests

Information on how to run the Symfony2 test suite can be found in the Running Symfony2 Tests section.