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 performance bottleneck by introducing a simple instance-level object cache #44

Merged
merged 2 commits into from
Oct 1, 2017

Conversation

maks-rafalko
Copy link
Member

There was a performance issue with opening and parsings (XPath) junit.xml thousands of times instead of caching the results.

This update eliminates the issue.

Blackfire comparison before/after: https://blackfire.io/profiles/compare/a6ef3b53-93c5-44b4-bf16-9c2510b44e61/graph?settings%5Bdimension%5D=wt&settings%5Bdisplay%5D=landscape&settings%5BtabPane%5D=nodes&selected=&callname=main()

On infection itself, the number of DomDocument::loadXML calls reduced by almost 8k times.

blackfire

@maks-rafalko maks-rafalko added this to the 0.5.4 milestone Sep 26, 2017
@snapshotpl
Copy link
Contributor

What are you think to make this change as decorator for TestFileDataProvider interface? It will be easly to to test and reuse with other implementations

@maks-rafalko
Copy link
Member Author

@snapshotpl great idea! Done. Would you mind reviewing the code?

@maks-rafalko maks-rafalko merged commit c77f5c6 into master Oct 1, 2017
@maks-rafalko maks-rafalko deleted the performance-fix branch October 7, 2017 08:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants