-
Notifications
You must be signed in to change notification settings - Fork 135
test: use globSource in add-dir benchmark #171
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
Conversation
- Use `globSource` from ipfs-utils for import - Make all impls return the same CID - Remove the dir size - if the CID is the same that's good enough
|
Before: After: |
|
The kubo-direct benchmarks are wildly different which is not something I expected to see. I'm not 100% convinced by tinybench, I think the test cases interfere with each other. That is, I've got different results in benchmarks by running them in a different order 🙃 |
whizzzkid
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nice, good improvements! minor nits!
| nodePath.relative(process.cwd(), nodePath.join(process.cwd(), '..', 'gc', 'src')), | ||
| ] | ||
| const testPaths = TEST_PATH != null | ||
| ? [TEST_PATH] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nice, I like this.
| }) | ||
|
|
||
| const addFile = async (path: string) => (await controller.api.add({ path: nodePath.relative(process.cwd(), path), content: fs.createReadStream(path)}, { cidVersion: 1, pin: false })).cid | ||
| const addFile = async (path: string): Promise<CID> => (await controller.api.add({ path: nodePath.relative(process.cwd(), path), content: fs.createReadStream(path) }, { cidVersion: 1, pin: false })).cid |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can we split this in a meaningful way to make this more readable?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not sure what you mean, it's as readable as it was before, the only change on this line is an automated linting fix.
That said, having it as a one-liner isn't very readable so I do agree it can be improved - can you suggest an edit instead?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Though maybe in #167 - it's probably out of scope here.
We could probably remove kubo-direct, and we should probably use a more reliable benchmark framework (or restructure these benchmarks to be more reliable) if we're pointing people to these. |
| addFile, | ||
| addDir, | ||
| // TODO: Fix timing out during size calculation. | ||
| // getSize: getFolderSize |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
My intention behind the size was to confirm all expected files/folders were read during the benchmark tests.
If we get the same CID from all implementations, we could cat one of them to confirm it's what we expect.
I think we should have some sort of validation but maybe we can handle that when we handle #170
* test: create add-dir benchmark * chore(bench/add-dir): remove unused taskResult prop * test(bench/add-dir): add kubo-direct test * docs(bench/add-dir): ipfs-core node_modules output * chore(bench/add-dir): kubo-direct doesnt pin files when adding * chore(bench/add-dir): split helia benchmark by blockstore type (fs/mem) * fix: ⚡ Double Digit Percentage Improvements. (#169) * fix: ⚡ 2x improvement Signed-off-by: Nishant Arora <[email protected]> * fix: dag generation with parallelization at each level --------- Signed-off-by: Nishant Arora <[email protected]> Co-authored-by: Russell Dempsey <[email protected]> * test: use globSource in add-dir benchmark (#171) * fix: use glob source for importing directories - Use `globSource` from ipfs-utils for import - Make all impls return the same CID - Remove the dir size - if the CID is the same that's good enough * chore: fix linting * chore: remove benchmark from workspaces * test: align error and success output headers --------- Signed-off-by: Nishant Arora <[email protected]> Co-authored-by: Nishant Arora <[email protected]> Co-authored-by: Alex Potsides <[email protected]>
globSourcefrom ipfs-utils for import