Skip to content
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

fix inefficient loop in getHookMethods and save up to 4% in cachegrind files #3429

Conversation

dynasource
Copy link
Contributor

@dynasource dynasource commented Nov 30, 2018

this commit is the result of finding a significant bottleneck in cachegrind files and performance gain up to 4% (measured in a project)

It fixes an inefficient loop in getHookMethods in which unnecessary logic can be executed when method docblock are not defined. It also minimizes calls to the same methods.

Also, the code is verbose enough to understand without the need for extra private methods.

@codecov
Copy link

codecov bot commented Nov 30, 2018

Codecov Report

Merging #3429 into master will decrease coverage by 0.01%.
The diff coverage is 100%.

Impacted file tree graph

@@             Coverage Diff              @@
##             master    #3429      +/-   ##
============================================
- Coverage     82.29%   82.28%   -0.02%     
+ Complexity     3569     3565       -4     
============================================
  Files           143      143              
  Lines          9376     9370       -6     
============================================
- Hits           7716     7710       -6     
  Misses         1660     1660
Impacted Files Coverage Δ Complexity Δ
src/Util/Test.php 92.67% <100%> (-0.1%) 206 <0> (-4)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update c607501...7107dbb. Read the comment docs.

@sebastianbergmann
Copy link
Owner

Can you please send this against 7.5? Thanks!

…egrind files

and performance gain up to 4% is measured in testsuites (of local projects).

It fixes an inefficient loop in getHookMethods in which unnecessary logic can be executed
when method docblock are are not defined. It also minimizes calls to the same methods.

Also, the code is verbose enough to understand without the need for extra private methods.
@sebastianbergmann sebastianbergmann added the type/enhancement A new idea that should be implemented label Dec 1, 2018
@sebastianbergmann sebastianbergmann added this to the PHPUnit 7.5 milestone Dec 1, 2018
@sebastianbergmann sebastianbergmann self-assigned this Dec 1, 2018
@sebastianbergmann
Copy link
Owner

Merged manually, thanks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type/enhancement A new idea that should be implemented
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants