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

chore: add transfer benchmark #90

Merged
merged 9 commits into from
Apr 22, 2024
Merged

Conversation

achingbrain
Copy link
Member

@achingbrain achingbrain commented Apr 13, 2023

Adds a benchmark suite for doing various size data transfers between helia and kubo.

Closes #88

Copy link
Member

@SgtPooki SgtPooki left a comment

Choose a reason for hiding this comment

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

just some comments

benchmarks/transfer/src/index.ts Outdated Show resolved Hide resolved
benchmarks/transfer/src/index.ts Show resolved Hide resolved
Comment on lines +93 to +96
const subjectA = await implA.create()
const subjectB = await implB.create()

const addr = await subjectB.addr()
await subjectA.dial(addr)

const cid = await subjectA.add(bufferStream(file.size), file.options)

Copy link
Member

Choose a reason for hiding this comment

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

Are the CIDs for each file in files unique? If so, we could move the creation of subjectA and subjectB outside of this inner-most for loop to right after the implA->implB log.

Copy link
Member

Choose a reason for hiding this comment

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

if not, it might be useful to utilize tinybench's beforeEach so it can handle timings appropriately

Copy link
Member Author

Choose a reason for hiding this comment

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

The CIDs are randomly generated but the nodes are set up/torn down on each iteration to ensure we're starting from fresh each time.

We're only measuring the transfer speed here so this doesn't affect the outcome.

Adds a benchmark suite for doing various size data transfers between
helia, kubo and js-ipfs.

Closes #88
@achingbrain
Copy link
Member Author

achingbrain commented Apr 22, 2024

Some stats from the latest release:

Using bitswap Helia is consistently faster transferring to and from other Helia nodes, and it's consistently faster reading data from Kubo.

Kubo is consistently slower reading data from Helia and transferring to and from other Kubo nodes.

image image

@achingbrain achingbrain marked this pull request as ready for review April 22, 2024 08:47
@achingbrain achingbrain requested a review from a team as a code owner April 22, 2024 08:47
@achingbrain achingbrain merged commit 52dbcf2 into main Apr 22, 2024
18 checks passed
@achingbrain achingbrain deleted the chore/add-transfer-benchmark branch April 22, 2024 13:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
No open projects
Status: 🎉 Done
Development

Successfully merging this pull request may close these issues.

Add benchmarks for data transfer
2 participants