Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/sinzii/delightfuldot-poc
PoC for delightfuldot project
https://github.com/sinzii/delightfuldot-poc
Last synced: 17 days ago
JSON representation
PoC for delightfuldot project
- Host: GitHub
- URL: https://github.com/sinzii/delightfuldot-poc
- Owner: sinzii
- Created: 2023-08-11T08:25:16.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2024-03-07T10:45:28.000Z (8 months ago)
- Last Synced: 2024-10-14T06:33:00.568Z (about 1 month ago)
- Language: TypeScript
- Size: 172 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# DelighfulDOT PoC
## Scripts
- `npm run build`: Build the source code
- `npm run dev`: Watch for changes and recompile files on changesBefore running profiles or benchmarks, make sure to run `npm run build` first to compile the source code to JavaScript, compiled code will be put in `dist` folder.
## Benchmark memory consumption when connecting to multiple network endpoints
Benchmarking scripts are located in folder `src/benchmarks`
### Command to run the benchmark
```ssh
node dist/benchmarks/benchmark_connect_multiple_endpoints.js -l [library] -n [numberOfNetworks]
```
Where:
- `[library]` is the library that will be used to connect: `polkadotapi`, `dedot` or `delightfuldot-poc`
- `[numberOfNetworks]` is the number of [network endpoints](https://github.com/sinzii/delightfuldot-poc/blob/main/src/util/networks.ts) to connect (`5`, `10`, `20`, `50`, `100`)E.g 1: Connect to `100` of network endpoints via `delightfuldot`
```ssh
node dist/benchmarks/benchmark_connect_multiple_endpoints.js -l delightfuldot -n 100
```E.g 2: Connect to `100` of network endpoints via `polkadotapi`
```ssh
node dist/benchmarks/benchmark_connect_multiple_endpoints.js -l polkadotapi -n 100
```### Memory consumption benchmark result
The benchmark was running on a Macbook Pro M1 / 32GB RAM - 512GB Storage, NodeJS v18.14.2
The memory consumption can be varied over time depending on various reasons. Below numbers are the average results of 5 consecutive runnings.
| Number of network endpoints | @polkadot/api | delightfuldot |
| ------------- | ------------- | ------------- |
| 5 | ~ 50 MB | ~ 18 MB |
| 10 | ~ 105 MB | ~ 25 MB |
| 20 | ~ 210 MB | ~ 40 MB |
| 50 | ~ 470 MB | ~ 90 MB |
| 100 | ~ 830 MB | ~ 140 MB |## Profiling
Profiling scripts are located in folder `src/profiles`
**Connect to Polkadot using `@polkadot/api`**
```ssh
node --inspecting dist/profiles/profile_connect_to_polkadot_via_polkadotapi.js
```**Connect to Polkadot using `delighfuldot`**
```ssh
node --inspecting dist/profiles/profile_connect_to_polkadot_via_delightfuldot_poc.js
```