Closed xepozz closed 1 year ago
Need to re-verify it.
My results:
Without cache:
+-----------+-----------+----------------------------+-------+-----+----------+---------+--------+
| benchmark | subject | set | revs | its | mem_peak | mode | rstdev |
+-----------+-----------+----------------------------+-------+-----+----------+---------+--------+
| MainBench | benchMake | without constructor | 10000 | 10 | 4.115mb | 0.771μs | ±2.96% |
| MainBench | benchMake | with empty constructor | 10000 | 10 | 4.118mb | 2.144μs | ±3.06% |
| MainBench | benchMake | with not empty constructor | 10000 | 10 | 4.124mb | 5.031μs | ±2.22% |
+-----------+-----------+----------------------------+-------+-----+----------+---------+--------+
With cache:
+-----------+-----------+----------------------------+-------+-----+----------+---------+--------+
| benchmark | subject | set | revs | its | mem_peak | mode | rstdev |
+-----------+-----------+----------------------------+-------+-----+----------+---------+--------+
| MainBench | benchMake | without constructor | 10000 | 10 | 4.116mb | 0.568μs | ±1.73% |
| MainBench | benchMake | with empty constructor | 10000 | 10 | 4.118mb | 1.991μs | ±2.41% |
| MainBench | benchMake | with not empty constructor | 10000 | 10 | 4.125mb | 4.719μs | ±2.91% |
+-----------+-----------+----------------------------+-------+-----+----------+---------+--------+
@xepozz would you please add a line for changelog?
@vjik worth checking if Factory performance could be improved the same way. Usage pattern is similar.
We need to check if the change slows down creating 1000 of different objects.
@vjik worth checking if Factory performance could be improved the same way. Usage pattern is similar.
Definitions caches reflection already: https://github.com/yiisoft/definitions/blob/master/src/Helpers/DefinitionExtractor.php#L37
Patch coverage: 100.00%
and no project coverage change.
Comparison is base (
e3968b3
) 100.00% compared to head (3ca4d05
) 100.00%.
:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.
Decided to replace constructor parameter to method withCacheReflections(bool)
Added reflections cache Now the results on my computer are:
Without that PR the results are (see #51):