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

Increase performance by raising default buffer sizes to 64 KiB #53

Merged
merged 1 commit into from
Nov 9, 2016

Conversation

clue
Copy link
Member

@clue clue commented Aug 20, 2016

The readable and writable side now use the same buffer sizes in order to avoid pausing the readable side when piping to a writable stream.

Running the examples/benchmark-throughput.php script, this change alone increases performance from ~100 MiB/s to ~1400 MiB/s on my (rather mediocre) test system, using PHP 7.0.8.

A buffer size of 64 KiB is a reasonable compromise between memory usage and performance, and the total buffer sizes can still be neglected even with thousands of open streams.

@clue clue added this to the v0.4.5 milestone Aug 20, 2016
@WyriHaximus
Copy link
Member

WyriHaximus commented Aug 20, 2016

Seeing an increase from 50MB/s to 700MB/s on my laptop with xdebug and from 260MB/s to 2500MB/s on the same laptop without xdebug, both on PHP 7. Big work servers stay the same at 700MB/s though on PHP 5.6, no xdebug.

👍 from me.

P.S. Like the commit message 😆

@cboden
Copy link
Member

cboden commented Aug 20, 2016

LGTM

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.

3 participants