Skip to content

Improve performance of Exporter::exportString() #64

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

Merged
merged 1 commit into from
Jun 18, 2024

Conversation

staabm
Copy link
Contributor

@staabm staabm commented Jun 18, 2024

remove a unnecessary function call in the hot path.

repro from sebastianbergmann/phpunit#5774 (comment) gets 6% faster

grafik

@staabm staabm changed the title Faster Exporter-> exportString() Faster Exporter->exportString() Jun 18, 2024
@staabm staabm marked this pull request as ready for review June 18, 2024 09:58
@@ -318,14 +319,14 @@ private function exportString(string $value): string
}

return "'" .
str_replace(
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

before the PR we processed each string twice.

@sebastianbergmann sebastianbergmann merged commit 8474a9e into sebastianbergmann:main Jun 18, 2024
5 checks passed
@sebastianbergmann sebastianbergmann changed the title Faster Exporter->exportString() Improve performance of Exporter::exportString() Jun 18, 2024
@staabm staabm deleted the exp-string branch June 18, 2024 11:31
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