Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/pfrazee/hyperswarm-bench
https://github.com/pfrazee/hyperswarm-bench
Last synced: 11 days ago
JSON representation
- Host: GitHub
- URL: https://github.com/pfrazee/hyperswarm-bench
- Owner: pfrazee
- Created: 2021-10-07T14:20:37.000Z (about 3 years ago)
- Default Branch: master
- Last Pushed: 2021-10-07T14:34:42.000Z (about 3 years ago)
- Last Synced: 2024-10-30T15:54:39.911Z (about 2 months ago)
- Language: JavaScript
- Size: 1.95 KB
- Stars: 3
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Hyperswarm connection establishment bench
This repo includes two benchmarks, which you use as follows:
1. On server, run `node hs-server.js`. It will emit a pubkey.
2. On client, run `PUBKEY=$PUBKEY node hs-client.js`. The Hyperswarm bench will run.
3. On server, close hs-server.js.
4. On server, run `node tcp-server.js`.
5. On client, run `HOST=$HOST PORT=12345 node tcp-client.js`. The TCP bench will run.Both benchmarks will go through 10 iterations.
Each iteration will open a connection, send a packet from client to server, echo the packet back from server to client, then close the connection.
These "open and echo" passes occur serially.Connecting between my Texas laptop and a Google Cloud us-central1-a server, I had the following results:
```
~/tmp/hyperswarm-conn-bench PUBKEY=... node hs-client.js
RT 0RT 1
RT 2
RT 3
RT 4
RT 5
RT 6
RT 7
RT 8
RT 9
Total MS: 7036
~/tmp/hyperswarm-conn-bench HOST=... PORT=12345 node tcp-client.js
RT 0RT 1
RT 2
RT 3
RT 4
RT 5
RT 6
RT 7
RT 8
RT 9
Total MS: 922
```