Skip to content

Commit

Permalink
chore: update benchmark
Browse files Browse the repository at this point in the history
  • Loading branch information
achingbrain committed Apr 19, 2024
1 parent f340371 commit 0e95ef8
Show file tree
Hide file tree
Showing 7 changed files with 26 additions and 94 deletions.
25 changes: 12 additions & 13 deletions benchmarks/transfer/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,27 +12,26 @@
"start": "npm run build && node dist/src/index.js"
},
"devDependencies": {
"@chainsafe/libp2p-noise": "^11.0.0",
"@chainsafe/libp2p-yamux": "^3.0.5",
"@helia/unixfs": "^1.2.1",
"@chainsafe/libp2p-noise": "^15.0.0",
"@chainsafe/libp2p-yamux": "^6.0.2",
"@helia/unixfs": "^3.0.3",
"@ipld/dag-pb": "^4.0.2",
"@libp2p/websockets": "^5.0.3",
"aegir": "^38.1.5",
"@libp2p/websockets": "^8.0.19",
"aegir": "^42.2.5",
"blockstore-fs": "^1.0.1",
"datastore-level": "^10.0.1",
"execa": "^7.0.0",
"go-ipfs": "^0.19.0",
"helia": "^1.0.0",
"ipfs-core": "^0.18.0",
"execa": "^8.0.1",
"helia": "^4.1.0",
"ipfs-unixfs-importer": "^15.1.1",
"ipfsd-ctl": "^13.0.0",
"ipfsd-ctl": "^14.0.0",
"it-all": "^3.0.1",
"it-buffer-stream": "^3.0.2",
"it-drain": "^3.0.1",
"it-map": "^3.0.2",
"kubo-rpc-client": "^3.0.1",
"libp2p": "^0.43.0",
"multiformats": "^11.0.1",
"kubo": "^0.28.0",
"kubo-rpc-client": "^4.0.0",
"libp2p": "^1.4.0",
"multiformats": "^13.1.0",
"tinybench": "^2.4.0"
},
"dependencies": {
Expand Down
2 changes: 1 addition & 1 deletion benchmarks/transfer/src/README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Transfer Benchmark

Benchmarks Helia transfer performance against js-ipfs and Kubo
Benchmarks Helia transfer performance against Kubo

To run:

Expand Down
6 changes: 2 additions & 4 deletions benchmarks/transfer/src/helia.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,7 @@ import { createHelia } from 'helia'
import { createLibp2p } from 'libp2p'
import { tcp } from '@libp2p/tcp'
import { noise } from '@chainsafe/libp2p-noise'
// import { yamux } from '@chainsafe/libp2p-yamux'
import { mplex } from '@libp2p/mplex'
import { yamux } from '@chainsafe/libp2p-yamux'
import type { TransferBenchmark } from './index.js'
import os from 'node:os'
import path from 'node:path'
Expand Down Expand Up @@ -33,8 +32,7 @@ export async function createHeliaBenchmark (): Promise<TransferBenchmark> {
noise()
],
streamMuxers: [
mplex()
// yamux()
yamux()
]
})
})
Expand Down
4 changes: 0 additions & 4 deletions benchmarks/transfer/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@

import type { CID } from 'multiformats/cid'
import { createHeliaBenchmark } from './helia.js'
import { createIpfsBenchmark } from './ipfs.js'
import { createKuboBenchmark } from './kubo.js'
import bufferStream from 'it-buffer-stream'
import type { Multiaddr } from '@multiformats/multiaddr'
Expand Down Expand Up @@ -75,9 +74,6 @@ for (const [name, options] of Object.entries(opts)) {
const impls: Array<{ name: string, create: () => Promise<TransferBenchmark> }> = [{
name: 'helia',
create: async () => await createHeliaBenchmark()
}, {
name: 'ipfs',
create: async () => await createIpfsBenchmark()
}, {
name: 'kubo',
create: async () => await createKuboBenchmark()
Expand Down
46 changes: 0 additions & 46 deletions benchmarks/transfer/src/ipfs.ts

This file was deleted.

29 changes: 9 additions & 20 deletions benchmarks/transfer/src/kubo.ts
Original file line number Diff line number Diff line change
@@ -1,28 +1,17 @@
import drain from 'it-drain'
import type { TransferBenchmark } from './index.js'
// @ts-expect-error no types
import * as goIpfs from 'go-ipfs'
import * as goRpcClient from 'kubo-rpc-client'
import { createController } from 'ipfsd-ctl'
import { path as kuboPath } from 'kubo'
import { create as kuboRpcClient } from 'kubo-rpc-client'
import { createNode } from 'ipfsd-ctl'

export async function createKuboBenchmark (): Promise<TransferBenchmark> {
const controller = await createController({
type: 'go',
const controller = await createNode({
type: 'kubo',
test: true,
ipfsBin: goIpfs.path(),
ipfsHttpModule: goRpcClient,
ipfsOptions: {
init: {
emptyRepo: true
},
config: {
Addresses: {
Swarm: [
'/ip4/127.0.0.1/tcp/0'
]
}
},
silent: true
bin: kuboPath(),
rpc: kuboRpcClient,
init: {
emptyRepo: true
}
})

Expand Down
8 changes: 2 additions & 6 deletions benchmarks/transfer/tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,14 +1,10 @@
{
"extends": "aegir/src/config/tsconfig.aegir.json",
"compilerOptions": {
"outDir": "dist",
"target": "ES2022",
"module": "ES2022",
"lib": ["ES2022", "DOM", "DOM.Iterable"]
"outDir": "dist"
},
"include": [
"src",
"test"
"src"
],
"references": [
{
Expand Down

0 comments on commit 0e95ef8

Please sign in to comment.