1
0
mirror of synced 2025-02-02 13:31:45 +03:00

11239 Commits

Author SHA1 Message Date
Marco Pivetta
ca436f0bae #7527 performance benchmark - verifying performance impact of inferred query parameter types
As an example result:

```
./phpbench.phar run tests/Doctrine/Performance/Query --iterations=50 --revs=50 --report=aggregate
PhpBench 0.15-dev (dcbe193). Running benchmarks.
Using configuration file: /home/ocramius/Documents/doctrine/doctrine2/phpbench.json

\Doctrine\Performance\Query\QueryBoundParameterProcessingBench

    benchExecuteParsedQueryWithInferredParameterTypeI49 P0 	[μ Mo]/r: 643.684 634.664 (μs) 	[μSD μRSD]/r: 17.700μs 2.75%
    benchExecuteParsedQueryWithDeclaredParameterTypeI49 P0 	[μ Mo]/r: 97.673 94.251 (μs) 	[μSD μRSD]/r: 8.259μs 8.46%

2 subjects, 100 iterations, 100 revs, 0 rejects, 0 failures, 0 warnings
(best [mean mode] worst) = 88.460 [370.679 364.458] 127.400 (μs)
⅀T: 37,067.880μs μSD/r 12.980μs μRSD/r: 5.603%
suite: 133f0e30090f815142331ebec6af18241694e7c0, date: 2018-12-19, stime: 10:47:10
+------------------------------------+--------------------------------------------------+--------+--------+------+-----+------------+-----------+-----------+-----------+-----------+----------+--------+-------+
| benchmark                          | subject                                          | groups | params | revs | its | mem_peak   | best      | mean      | mode      | worst     | stdev    | rstdev | diff  |
+------------------------------------+--------------------------------------------------+--------+--------+------+-----+------------+-----------+-----------+-----------+-----------+----------+--------+-------+
| QueryBoundParameterProcessingBench | benchExecuteParsedQueryWithInferredParameterType |        | []     | 50   | 50  | 5,970,568b | 604.680μs | 643.684μs | 634.664μs | 677.640μs | 17.700μs | 2.75%  | 6.59x |
| QueryBoundParameterProcessingBench | benchExecuteParsedQueryWithDeclaredParameterType |        | []     | 50   | 50  | 5,922,424b | 88.460μs  | 97.673μs  | 94.251μs  | 127.400μs | 8.259μs  | 8.46%  | 1.00x |
+------------------------------------+--------------------------------------------------+--------+--------+------+-----+------------+-----------+-----------+-----------+-----------+----------+--------+-------+
```

This indicates that the performance impact for NOT declaring parameter types
explicitly is *MASSIVE*.
2018-12-19 10:52:11 +01:00
Marco Pivetta
23af164d7a Note: this will still lead to the UnitOfWork#getSingleIdentifierValue() still being
called when not specifying the type of a DQL parameter being bound via
`Doctrine\ORM\Query#setParameter()`:

```php
$query->setParameter('foo', $theValue, $theType);
```

A full parameter bind is required in order to gain back performance:

```php
$query->setParameter('foo', $theValue, $theType);
```

This is up for discussion with patch reviewers.
2018-12-16 18:05:02 +01:00
Marco Pivetta
960a437d46 #7527 failing test case: UnitOfWork#getSingleIdentifierValue() should not be called for a well specified parameter type
As previously reported by @flaushi in https://github.com/doctrine/doctrine2/pull/7471#discussion_r241949045, we discovered
that binding a parameter causes a `ClassMetadataFactory#getClassMetadata()` call, which in turn leads to large performance
regression when using any `object` type as parameter.

Following two snippets lead to an internal `ClassMetadataFactory#getClassMetadata()` call, which in turn leads to an
exception being thrown and garbage collected, plus multiple associated performance implications:

```php
$query->setParameter('foo', new DateTime());
$query->getResult();
```

```php
$query->setParameter('foo', new DateTime(), DateTimeType::NAME);
$query->getResult();
```

This is due to following portion of code:

434820973c/lib/Doctrine/ORM/Query.php (L406-L409)

Notice how `$value = $this->processParameterValue($value);` happens before attempting to infer the type for the parameter value.

That call leads to this segment being reached, which leads to the regression:

434820973c/lib/Doctrine/ORM/AbstractQuery.php (L423-L433)

Assuming the bound parameter type is provided, we can completely skip attempting to introspect the given object:

```php
$query->setParameter('foo', new DateTime(), DateTimeType::NAME);
$query->getResult();
```

Processing the parameter value is not needed in this case, so we can safely skip that logic for all known parameters.
In order to not introduce a BC break or change the `AbstractQuery#processParameterValue()` implementation, we could filter
out all parameters for which the type is given upfront, and later on merge them back in instead.

The test expectation to be set is for `UnitOfWork#getSingleIdentifierValue()` to never be called.
2018-12-16 15:37:45 +01:00
Marco Pivetta
237bebe2ed
Merge pull request #7519 from koftikes/fix/#7518-phpdoc-error
#7518 Fixed type mismatch between `EntityRepository#__construct()` and its documented constructor arguments
2018-12-13 08:14:30 +01:00
Jonathan H. Wage
fc3dca772e
Merge pull request #7521 from doctrine/update-chat-link
Update chat link from Gitter to Slack.
2018-12-12 20:07:31 +00:00
Konstantin Litvinov
ee64d31f48 7518 Fixed PHPDoc Error. 2018-12-12 17:08:35 +03:00
Michael Moravec
493ff74a0d
Merge pull request #7473 from Majkl578/incremental-cs-2.x
Incremental CS checks in 2.x branches
2018-12-10 14:43:55 +01:00
Michael Moravec
78c7000962
Lock dependencies for Code Quality stage 2018-12-10 13:58:51 +01:00
Michael Moravec
6a05e01298
Perform incremental coding standard checks for pull requests 2018-12-10 13:58:51 +01:00
Gabriel Ostrolucký
7de3434733
Update doctrine/coding-standard in 2.x branch
Co-Authored-By: Michael Moravec <me@majkl.me>
2018-12-10 13:58:51 +01:00
Luís Cobucci
74e6189f3e
Merge pull request #7483 from javiereguiluz/patch-9
Fixed a minor syntax issue
2018-11-21 10:48:33 +01:00
Javier Eguiluz
2e7a3affba
Fixed a minor syntax issue 2018-11-21 09:06:54 +01:00
Luís Cobucci
505ec21f97
Bump up development version 2018-11-21 01:24:06 +01:00
Luís Cobucci
434820973c
Bump up version 2018-11-21 00:46:46 +01:00
Luís Cobucci
41ff526921
Merge pull request #6830 from Tobion/fix-collation-foreign-key
fix applying column options on foreign key columns
2018-11-21 00:41:17 +01:00
Luís Cobucci
0be52b0087
Isolate entities used by the new test
To ensure we don't have any unintended side-effect.
2018-11-21 00:20:20 +01:00
Tobias Schultze
ee8dc496d9
Fix applying collation on foreign key columns 2018-11-21 00:20:15 +01:00
Luís Cobucci
f80656cddf
Merge pull request #7317 from protecinnovations/fix/7316-xml-order-by-dir-many-to-many
[XML] Fix default value of many-to-many order-by to ASC
2018-11-20 13:11:22 +01:00
Alex Denvir
72121c01ec
[XML] Fix default value of many-to-many order-by to ASC 2018-11-20 12:33:29 +01:00
Luís Cobucci
ac505390dd
Merge pull request #7472 from seferov/patch-2
fix incorrect phpdoc typehint
2018-11-20 09:41:01 +01:00
Luís Cobucci
728e6e15c5
Merge pull request #7441 from asgrim/fix-getResult-type
$hydrationMode throughout can be a string as well as int (for custom modes)
2018-11-20 09:40:04 +01:00
Luís Cobucci
d21305378c
Merge pull request #7471 from alcaeus/fix-unloaded-metadata-parameter-processing
Fix parameter value processing for objects with unloaded metadata
2018-11-15 11:34:31 +01:00
Andreas Braun
0552749059
Fix parameter value processing for objects with unloaded metadata 2018-11-15 11:21:05 +01:00
Farhad Safarov
fbd3fe95e4
fix incorrect phpdoc typehint 2018-11-13 13:01:10 +03:00
James Titcumb
c6d02daee0
$hydrationMode throughout can be a string as well as int (for custom modes) 2018-11-12 13:58:42 +00:00
Luís Cobucci
5208035003
Merge pull request #7444 from naitsirch/fix/issue6968
Fixed URLs of doctrine-mapping.xsd in docs
2018-11-12 11:40:01 +01:00
Luís Cobucci
d93956eff0
Use HTTPS endpoint for XML schema location 2018-11-12 11:29:32 +01:00
naitsirch
b3b06d3e7d
Fixed URLs of doctrine-mapping.xsd in docs
Until now the references to the `doctrine-mapping.xsd` consisted of different URLs.

A grep of docs showed:
* /Users/robo/dev/php/Doctrine/doctrine-mapping.xsd
* http://doctrine-project.org/schemas/orm/doctrine-mapping.xsd
* http://www.doctrine-project.org/schemas/orm/doctrine-mapping.xsd
* https://raw.github.com/doctrine/doctrine2/master/doctrine-mapping.xsd

Now it is used http://doctrine-project.org/schemas/orm/doctrine-mapping.xsd everywhere.
2018-11-12 11:09:15 +01:00
Michael Moravec
427f815975
Merge pull request #7465 from unguul/patch-1
Fixes tiny typo in the 'Working with DateTime instances' documentation
2018-11-11 23:24:29 +01:00
Michael Moravec
bf601ce268
Merge pull request #7421 from seferov/patch-1
JIRA to Github issues on Limitations and Known Issues
2018-11-11 23:24:00 +01:00
Michael Moravec
8bfb363fcc
Merge pull request #7434 from naitsirch/fix/doc-faq-public-property
Removed FAQ paragraph stating public variables are disallowed
2018-11-11 23:22:58 +01:00
Michael Moravec
ebf2630a66
Merge pull request #7435 from oguzdumanoglu/patch-2
Fix a typo on Documentation
2018-11-11 23:22:25 +01:00
Michael Moravec
9018955e1f
Merge pull request #7412 from ThomasLandauer/patch-1
Some formatting improvements
2018-11-10 21:05:50 +01:00
Thomas Landauer
88d58ae0a3
Some formatting improvements 2018-11-10 20:45:03 +01:00
Michael Moravec
2fc99afd44
Merge pull request #7423 from ThomasLandauer/patch-2
Update association-mapping.rst
2018-11-10 20:40:44 +01:00
Michael Moravec
fa0885e25d
Merge pull request #7374 from SenseException/deprecate-yaml-docs
Deprecation message in documentation for YAML
2018-11-10 20:33:51 +01:00
Alexandru Ungureanu
0e4a0108d2
Fixes small typo 2018-11-08 13:59:21 +02:00
Oguz Dumanoglu
58370256c0
Fix a typo
There was a typo in Working with Associations page.
2018-10-19 16:32:27 +02:00
naitsirch
d5364231c2 Removed FAQ paragraph stating public variables are disallowed
In #7427 @flaushi mentioned the outdated paragraph. This commit removes
this one.
2018-10-18 22:36:29 +02:00
Luís Cobucci
4df3a4d436
Merge pull request #7428 from Majkl578/php7.3
CI: Test against PHP 7.3
2018-10-14 09:39:26 +02:00
Michael Moravec
812989490c
CI: Test against PHP 7.3 2018-10-13 20:33:26 +02:00
Thomas Landauer
892ef9edb7
Update association-mapping.rst
Added info about owning and inverse side.
2018-10-09 21:33:42 +02:00
Farhad Safarov
982782f8c9
JIRA to Github issues 2018-10-09 11:52:22 +03:00
Michael Moravec
7319f524a3
Merge pull request #7397 from eibt/patch-1
Update getting-started.rst
2018-09-23 07:04:34 +02:00
Michael Moravec
1d71fbf77b
Merge pull request #7367 from timdev/fix/entitymanager-find-with-optimistic-lock-no-need-tx
Fix for BC break in 2.6.2 when calling EM::find() with LockMode::OPTIMISTIC outside of a TX
2018-09-23 06:43:26 +02:00
Ivan
7eacfec2c3
Fix typo in getting-started.rst 2018-09-23 06:39:11 +02:00
Michael Moravec
46f2a41cf7
Merge pull request #7377 from sserbin/fix-query-andx-doctype
Fix query andX doctype
2018-09-23 06:37:42 +02:00
Michael Moravec
fd2baf6f65
Merge pull request #7260 from stof/regression_commit_order
Fix the handling of circular references in the commit order calculator
2018-09-23 05:44:14 +02:00
Michael Moravec
c8bf06d549
Merge pull request #7401 from bobdenotter/patch-1
[docs] Fix docblock in `inheritance-mapping.rst`
2018-09-23 05:34:59 +02:00
Tim Lieberman
3acfa50214
Fix for BC break #7366 when calling EM::find() with LockMode::OPTIMISTIC outside of a TX 2018-09-23 05:33:05 +02:00