mirror of
https://github.com/ChainSafe/lodestar.git
synced 2026-01-09 15:48:08 -05:00
**Motivation** - #7280 **Description** - Build upon the isomorphic bytes code in the utils package - refactor browser/nodejs selection to use conditional imports (like how we've been handling bun / nodejs selection - Use Uint8Array.fromHex and toHex (mentioned in https://github.com/ChainSafe/lodestar/pull/8275#issuecomment-3228184163) - Refactor the bytes perf tests to include bun - Add lodestar-bun dependency (also add missing dependency in beacon-node package) Results from my machine ``` bytes utils ✔ nodejs block root to RootHex using toHex 5500338 ops/s 181.8070 ns/op - 1048 runs 0.444 s ✔ nodejs block root to RootHex using toRootHex 7466866 ops/s 133.9250 ns/op - 2189 runs 0.477 s ✔ nodejs fromHex(blob) 7001.930 ops/s 142.8178 us/op - 10 runs 1.94 s ✔ nodejs fromHexInto(blob) 1744.298 ops/s 573.2965 us/op - 10 runs 6.33 s ✔ nodejs block root to RootHex using the deprecated toHexString 1609510 ops/s 621.3070 ns/op - 309 runs 0.704 s ✔ browser block root to RootHex using toHex 1854390 ops/s 539.2610 ns/op - 522 runs 0.807 s ✔ browser block root to RootHex using toRootHex 2060543 ops/s 485.3090 ns/op - 597 runs 0.805 s ✔ browser fromHex(blob) 1632.601 ops/s 612.5196 us/op - 10 runs 6.77 s ✔ browser fromHexInto(blob) 1751.718 ops/s 570.8683 us/op - 10 runs 6.36 s ✔ browser block root to RootHex using the deprecated toHexString 1596024 ops/s 626.5570 ns/op - 457 runs 0.805 s ✔ bun block root to RootHex using toHex 1.249563e+7 ops/s 80.02800 ns/op - 4506 runs 0.518 s ✔ bun block root to RootHex using toRootHex 1.262626e+7 ops/s 79.20000 ns/op - 3716 runs 0.409 s ✔ bun fromHex(blob) 26995.09 ops/s 37.04377 us/op - 10 runs 0.899 s ✔ bun fromHexInto(blob) 31539.09 ops/s 31.70668 us/op - 13 runs 0.914 s ✔ bun block root to RootHex using the deprecated toHexString 1.252944e+7 ops/s 79.81200 ns/op - 3616 runs 0.414 s ```
9 lines
141 B
JSON
9 lines
141 B
JSON
{
|
|
"extends": "../../tsconfig.json",
|
|
"include": ["src", "test"],
|
|
"compilerOptions": {
|
|
"rootDir": "../..",
|
|
"outDir": "lib"
|
|
}
|
|
}
|