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: high throughput streams #8

Merged
merged 2 commits into from Feb 20, 2019

Conversation

2 participants
@jacobheun
Copy link
Contributor

commented Feb 20, 2019

While testing ipfs/interop I encountered an issue with high throughput streams (file transfers). This adds a benchmark to test a large file transfer. Currently it tests a 128MB file. The performance issue was due to an improper checking of the logger being enabled. toString was being called unnecessarily, which caused a large block in IO. Details of the performance differences are below.

New Benchmark: Large file

# Before the fix
$ node large-file.js --lib=pull-mplex --repeat=1 --runs=3
sendFile*1: 6589.224ms
sendFile*1: 6592.975ms
sendFile*1: 6575.001ms

# After the fix
$ node large-file.js --lib=pull-mplex --repeat=1 --runs=3
sendFile*1: 365.876ms
sendFile*1: 299.767ms
sendFile*1: 321.524ms

pull-mplex vs libp2p-mplex

# pull-mplex
$ node large-file.js --lib=pull-mplex --repeat=1 --runs=3
sendFile*1: 403.556ms
sendFile*1: 346.207ms
sendFile*1: 306.421ms

# libp2p-mplex
$ node large-file.js --lib=libp2p-mplex --repeat=1 --runs=3
sendFile*1: 519.056ms
sendFile*1: 481.365ms
sendFile*1: 465.422ms

jacobheun added some commits Feb 20, 2019

@ghost ghost assigned jacobheun Feb 20, 2019

@ghost ghost added the in progress label Feb 20, 2019

@jacobheun jacobheun requested a review from vasco-santos Feb 20, 2019

@vasco-santos
Copy link
Member

left a comment

Wow, what an edge case!

Awesome improvements 🚀

@jacobheun jacobheun merged commit 45597f9 into master Feb 20, 2019

4 checks passed

Travis CI - Branch Build Passed
Details
Travis CI - Pull Request Build Passed
Details
codecov/patch 100% of diff hit (target 90.5%)
Details
codecov/project Absolute coverage decreased by -0.29% but relative coverage increased by +9.49% compared to 9b5fc69
Details

@ghost ghost removed the in progress label Feb 20, 2019

@jacobheun jacobheun deleted the fix/memory branch Feb 20, 2019

@alanshaw alanshaw referenced this pull request May 9, 2019

Closed

⚡️ v0.36.0 RELEASE 🚀 #2024

43 of 44 tasks complete
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.