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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

Faster dump by less tiny writes() #280

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open

Conversation

staabm
Copy link

@staabm staabm commented Feb 22, 2024

while writing the dump the script is doing millions of tiny writes().

after this PR we are buffering the contents within a string a do the write only after we reached the net-buffer-length.
this means we are doing waaaay less IO calls.

before this PR:

mstaab@mst22:/cluster/www/www/www/mysqldump-php$ time php test2.php

real    0m14.194s
user    0m10.762s
sys     0m2.340s

after this PR

mstaab@mst22:/cluster/www/www/www/mysqldump-php$ time php test2.php

real    0m7.492s
user    0m6.403s
sys     0m0.204s

which is now 40-50% faster 馃殌

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.

None yet

1 participant