Skip to content

Commit

Permalink
test: migrate spec-test-utils and spec tests to vitest (#6222)
Browse files Browse the repository at this point in the history
* Migrate spec-test-utils and spec tests to vitest

* Fix build check

* Fix export path

* Add config file

* Fix spec tests

* Fix the duplicate package script

* Fix spec tests

* Fix lint errors

* Update the spec tests runner tasks

* Fix the import for a spec test

* Fix the import for a spec test

* Fix spec tests

* Update the task runner

* Run spec test in fork not threads

* Fix the config file path

* Fix validator spec tests

* Fix e2e tests

* Make the validator spec tests run in parallel

* Update the spec test runner options
  • Loading branch information
nazarhussain authored Jan 15, 2024
1 parent 88744d8 commit 4996f4d
Show file tree
Hide file tree
Showing 36 changed files with 163 additions and 92 deletions.
11 changes: 7 additions & 4 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -321,12 +321,15 @@ jobs:
# Run them in different steps to quickly identifying which command failed
# Otherwise just doing `yarn test:spec` you can't tell which specific suite failed
# many of the suites have identical names for minimal and mainnet
- name: Spec tests bls-general
run: yarn test:spec-bls-general
- name: Spec tests general
run: yarn test:spec:general
working-directory: packages/beacon-node
- name: Spec tests bls
run: yarn test:spec:bls
working-directory: packages/beacon-node
- name: Spec tests minimal
run: yarn test:spec-minimal
run: yarn test:spec:minimal
working-directory: packages/beacon-node
- name: Spec tests mainnet
run: NODE_OPTIONS='--max-old-space-size=4096' yarn test:spec-mainnet
run: NODE_OPTIONS='--max-old-space-size=4096' yarn test:spec:mainnet
working-directory: packages/beacon-node
7 changes: 0 additions & 7 deletions packages/beacon-node/.mocharc.spec.cjs

This file was deleted.

9 changes: 0 additions & 9 deletions packages/beacon-node/.mocharc.yml

This file was deleted.

3 changes: 0 additions & 3 deletions packages/beacon-node/.nycrc.json

This file was deleted.

10 changes: 5 additions & 5 deletions packages/beacon-node/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -87,11 +87,11 @@
"test:sim:withdrawals": "mocha 'test/sim/withdrawal-interop.test.ts'",
"test:sim:blobs": "mocha 'test/sim/4844-interop.test.ts'",
"download-spec-tests": "node --loader=ts-node/esm test/spec/downloadTests.ts",
"check-spec-tests": "mocha test/spec/checkCoverage.ts",
"test:spec-bls-general": "mocha --config .mocharc.spec.cjs 'test/spec/bls/**/*.test.ts' 'test/spec/general/**/*.test.ts'",
"test:spec-minimal": "LODESTAR_PRESET=minimal mocha --config .mocharc.spec.cjs 'test/spec/presets/**/*.test.ts'",
"test:spec-mainnet": "LODESTAR_PRESET=mainnet mocha --config .mocharc.spec.cjs 'test/spec/presets/**/*.test.ts'",
"test:spec": "yarn test:spec-bls-general && yarn test:spec-minimal && yarn test:spec-mainnet",
"test:spec:bls": "vitest --run --config vitest.config.spec.ts --dir test/spec/bls/",
"test:spec:general": "vitest --run --config vitest.config.spec.ts --dir test/spec/general/",
"test:spec:minimal": "LODESTAR_PRESET=minimal vitest --run --config vitest.config.spec.ts --dir test/spec/presets/",
"test:spec:mainnet": "LODESTAR_PRESET=mainnet vitest --run --config vitest.config.spec.ts --dir test/spec/presets/",
"test:spec": "yarn test:spec:bls && yarn test:spec:general && yarn test:spec:minimal && yarn test:spec:mainnet",
"check-readme": "typescript-docs-verifier"
},
"dependencies": {
Expand Down
14 changes: 10 additions & 4 deletions packages/beacon-node/test/spec/bls/index.test.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import fs from "node:fs";
import path from "node:path";
import jsyaml from "js-yaml";
import {expect} from "chai";
import {expect, describe, it} from "vitest";
import {blsSpecTests} from "../specTestVersioning.js";
import {readdirSyncSpec} from "../utils/specTestIterator.js";
import {testFnByType} from "./bls.js";
Expand Down Expand Up @@ -35,15 +35,21 @@ for (const fnName of readdirSyncSpec(blsSpecTests.outputDir)) {

const fnTestDirpath = path.join(blsSpecTests.outputDir, fnName);
for (const testName of readdirSyncSpec(fnTestDirpath)) {
it(`${fnName}/${testName}`, function () {
// TODO: Will be removed when we remove chai/mocha eslint rules
// eslint-disable-next-line mocha/handle-done-callback
it(`${fnName}/${testName}`, function (context) {
if (fn === "skip") {
this.skip();
// TODO: Will be removed when we remove chai/mocha eslint rules
// eslint-disable-next-line mocha/no-nested-tests
context.skip();
return;
}

// Do not manually skip tests here, do it in the top of the file
if (skippedTestNames.includes(testName)) {
this.skip();
// TODO: Will be removed when we remove chai/mocha eslint rules
// eslint-disable-next-line mocha/no-nested-tests
context.skip();
return;
}

Expand Down
2 changes: 1 addition & 1 deletion packages/beacon-node/test/spec/downloadTests.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import {downloadTests} from "@lodestar/spec-test-util";
import {downloadTests} from "@lodestar/spec-test-util/downloadTests";
import {ethereumConsensusSpecsTests, blsSpecTests} from "./specTestVersioning.js";

/* eslint-disable no-console */
Expand Down
2 changes: 1 addition & 1 deletion packages/beacon-node/test/spec/general/ssz_generic.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import fs from "node:fs";
import path from "node:path";
import {expect} from "chai";
import {expect, it} from "vitest";
import {TestRunnerCustom} from "../utils/types.js";
import {parseSszGenericInvalidTestcase, parseSszGenericValidTestcase} from "../utils/sszTestCaseParser.js";
import {runValidSszTest} from "../utils/runValidSszTest.js";
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import path from "node:path";
import {expect} from "chai";
import {expect} from "vitest";
import {
CachedBeaconStateAllForks,
EpochTransitionCache,
Expand Down
7 changes: 5 additions & 2 deletions packages/beacon-node/test/spec/presets/fork_choice.test.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import path from "node:path";
import {expect} from "chai";
import {expect} from "vitest";
import {toHexString} from "@chainsafe/ssz";
import {BeaconStateAllForks, isExecutionStateType, signedBlockToSignedHeader} from "@lodestar/state-transition";
import {InputType} from "@lodestar/spec-test-util";
Expand All @@ -8,7 +8,7 @@ import {phase0, allForks, bellatrix, ssz, RootHex, deneb} from "@lodestar/types"
import {bnToNum, fromHex} from "@lodestar/utils";
import {createBeaconConfig} from "@lodestar/config";
import {ACTIVE_PRESET, ForkSeq, isForkBlobs} from "@lodestar/params";
import {BeaconChain} from "../../../src/chain/index.js";
import {BeaconChain, ChainEvent} from "../../../src/chain/index.js";
import {ClockEvent} from "../../../src/util/clock.js";
import {computeInclusionProof} from "../../../src/util/blobs.js";
import {createCachedBeaconStateTest} from "../../utils/cachedBeaconState.js";
Expand Down Expand Up @@ -112,6 +112,9 @@ const forkChoiceTest =
}
);

// The handler of `ChainEvent.forkChoiceFinalized` access `db.block` and raise error if not found.
chain.emitter.removeAllListeners(ChainEvent.forkChoiceFinalized);

const stepsLen = steps.length;
logger.debug("Fork choice test", {steps: stepsLen});

Expand Down
2 changes: 1 addition & 1 deletion packages/beacon-node/test/spec/presets/genesis.test.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import path from "node:path";
import {expect} from "chai";
import {expect} from "vitest";
import {phase0, Root, ssz, TimeSeconds, allForks, deneb} from "@lodestar/types";
import {InputType} from "@lodestar/spec-test-util";
import {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import {expect} from "chai";
import {expect} from "vitest";
import {Tree} from "@chainsafe/persistent-merkle-tree";
import {TreeViewDU, Type} from "@chainsafe/ssz";
import {RootHex, ssz} from "@lodestar/types";
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import {expect} from "chai";
import {expect} from "vitest";
import {init} from "@chainsafe/bls/switchable";
import {isForkLightClient} from "@lodestar/params";
import {altair, phase0, RootHex, Slot, ssz} from "@lodestar/types";
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import {expect} from "chai";
import {expect} from "vitest";
import {altair, ssz, allForks} from "@lodestar/types";
import {isForkLightClient} from "@lodestar/params";
import {InputType} from "@lodestar/spec-test-util";
Expand Down
2 changes: 1 addition & 1 deletion packages/beacon-node/test/spec/presets/merkle.test.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import path from "node:path";
import {expect} from "chai";
import {expect} from "vitest";
import {ProofType, SingleProof, Tree} from "@chainsafe/persistent-merkle-tree";
import {fromHexString, toHexString} from "@chainsafe/ssz";
import {ssz} from "@lodestar/types";
Expand Down
2 changes: 1 addition & 1 deletion packages/beacon-node/test/spec/presets/rewards.test.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import path from "node:path";
import {expect} from "chai";
import {expect} from "vitest";
import {VectorCompositeType} from "@chainsafe/ssz";
import {BeaconStateAllForks, beforeProcessEpoch} from "@lodestar/state-transition";
import {getRewardsAndPenalties} from "@lodestar/state-transition/epoch";
Expand Down
3 changes: 2 additions & 1 deletion packages/beacon-node/test/spec/presets/ssz_static.test.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import fs from "node:fs";
import path from "node:path";
import {it, vi} from "vitest";
import {Type} from "@chainsafe/ssz";
import {ssz} from "@lodestar/types";
import {ACTIVE_PRESET, ForkName, ForkLightClient} from "@lodestar/params";
Expand Down Expand Up @@ -58,7 +59,7 @@ const sszStatic =
it(testCase, function () {
// Mainnet must deal with big full states and hash each one multiple times
if (ACTIVE_PRESET === "mainnet") {
this.timeout(30 * 1000);
vi.setConfig({testTimeout: 30 * 1000});
}

const testData = parseSszStaticTestcase(path.join(testSuiteDirpath, testCase));
Expand Down
2 changes: 1 addition & 1 deletion packages/beacon-node/test/spec/specTestVersioning.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import path from "node:path";
import {fileURLToPath} from "node:url";
import {DownloadTestsOptions} from "@lodestar/spec-test-util";
import {DownloadTestsOptions} from "@lodestar/spec-test-util/downloadTests";

// WARNING! Don't move or rename this file !!!
//
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import {expect} from "chai";
import {expect} from "vitest";
import {allForks, ssz} from "@lodestar/types";
import {ForkName} from "@lodestar/params";
import {InputType} from "@lodestar/spec-test-util";
Expand Down
2 changes: 1 addition & 1 deletion packages/beacon-node/test/spec/utils/runValidSszTest.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import {expect} from "chai";
import {expect} from "vitest";
import {Node} from "@chainsafe/persistent-merkle-tree";
import {Type, CompositeType, fromHexString, toHexString} from "@chainsafe/ssz";

Expand Down
1 change: 1 addition & 0 deletions packages/beacon-node/test/spec/utils/specTestIterator.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import fs from "node:fs";
import path from "node:path";
import {describe, it} from "vitest";
import {ForkName} from "@lodestar/params";
import {describeDirectorySpecTest} from "@lodestar/spec-test-util";
import {RunnerType, TestRunner} from "./types.js";
Expand Down
19 changes: 19 additions & 0 deletions packages/beacon-node/vitest.config.spec.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
import {defineConfig, mergeConfig} from "vitest/config";
import vitestConfig from "../../vitest.base.config";

export default mergeConfig(
vitestConfig,
defineConfig({
test: {
globalSetup: ["./test/globalSetup.ts"],
testTimeout: 60_000,
passWithNoTests: true,
pool: "threads",
poolOptions: {
threads: {
isolate: false,
},
},
},
})
);
4 changes: 0 additions & 4 deletions packages/spec-test-util/.mocharc.yaml

This file was deleted.

3 changes: 0 additions & 3 deletions packages/spec-test-util/.nycrc.json

This file was deleted.

29 changes: 22 additions & 7 deletions packages/spec-test-util/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,24 @@
},
"homepage": "https://github.com/ChainSafe/lodestar#readme",
"type": "module",
"exports": "./lib/index.js",
"exports": {
".": {
"import": "./lib/index.js"
},
"./downloadTests": {
"import": "./lib/downloadTests.js"
}
},
"types": "lib/index.d.ts",
"typesVersions": {
"*": {
"*": [
"*",
"lib/*",
"lib/*/index"
]
}
},
"files": [
"lib/**/*.js",
"lib/**/*.js.map",
Expand All @@ -26,12 +42,13 @@
"build": "tsc -p tsconfig.build.json",
"build:release": "yarn clean && yarn build",
"build:watch": "yarn run build --watch",
"check-build": "node -e \"(async function() { await import('./lib/index.js') })()\"",
"check-build": "node -e \"(async function() { await import('./lib/downloadTests.js') })()\"",
"check-types": "tsc",
"lint": "eslint --color --ext .ts src/ test/",
"lint:fix": "yarn run lint --fix",
"pretest": "yarn run check-types",
"test:e2e": "mocha 'test/e2e/**/*.test.ts'",
"test:unit": "vitest --run --passWithNoTests --dir test/unit/ --coverage",
"test:e2e": "vitest --run --dir test/e2e/",
"check-readme": "typescript-docs-verifier"
},
"repository": {
Expand All @@ -48,8 +65,7 @@
"@lodestar/utils": "^1.13.0",
"async-retry": "^1.3.3",
"axios": "^1.3.4",
"chai": "^4.3.7",
"mocha": "^10.2.0",
"vitest": "^1.0.2",
"rimraf": "^4.4.1",
"snappyjs": "^0.7.0",
"tar": "^6.1.13"
Expand All @@ -59,7 +75,6 @@
"@types/tar": "^6.1.4"
},
"peerDependencies": {
"chai": "^4.3.7",
"mocha": "^10.2.0"
"vitest": "^1.0.2"
}
}
10 changes: 5 additions & 5 deletions packages/spec-test-util/src/single.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import fs from "node:fs";
import path from "node:path";
import {expect} from "chai";
import {describe, it, vi, expect} from "vitest";
import {uncompress} from "snappyjs";
import {loadYaml} from "@lodestar/utils";

Expand Down Expand Up @@ -103,7 +103,7 @@ export function describeDirectorySpecTest<TestCase extends {meta?: any}, Result>

describe(name, function () {
if (options.timeout !== undefined) {
this.timeout(options.timeout || "10 min");
vi.setConfig({testTimeout: options.timeout ?? 10 * 60 * 1000});
}

for (const testSubDirname of fs.readdirSync(testCaseDirectoryPath)) {
Expand All @@ -112,9 +112,9 @@ export function describeDirectorySpecTest<TestCase extends {meta?: any}, Result>
continue;
}

// Use full path here, not just `testSubDirname` to allow usage of `mocha --grep`
// Use full path here, not just `testSubDirname` to allow usage of `vitest --grep`
const testName = `${name}/${testSubDirname}`;
it(testName, async function () {
it(testName, async function (context) {
// some tests require to load meta.yaml first in order to know respective ssz types.
const metaFilePath = path.join(testSubDirPath, "meta.yaml");
const meta: TestCase["meta"] = fs.existsSync(metaFilePath)
Expand All @@ -124,7 +124,7 @@ export function describeDirectorySpecTest<TestCase extends {meta?: any}, Result>
let testCase = loadInputFiles(testSubDirPath, options, meta);
if (options.mapToTestCase) testCase = options.mapToTestCase(testCase);
if (options.shouldSkip && options.shouldSkip(testCase, testName, 0)) {
this.skip();
context.skip();
return;
}

Expand Down
5 changes: 3 additions & 2 deletions packages/spec-test-util/test/e2e/single/index.test.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import fs from "node:fs";
import path from "node:path";
import {fileURLToPath} from "node:url";
import {beforeAll, afterAll} from "vitest";
import {ContainerType, Type} from "@chainsafe/ssz";
import {ssz} from "@lodestar/types";
import {describeDirectorySpecTest, InputType, loadYamlFile} from "../../../src/single.js";
Expand Down Expand Up @@ -31,14 +32,14 @@ const sampleContainerType = new ContainerType({
number: ssz.UintNum64,
});

before(() => {
beforeAll(() => {
yamlToSSZ(path.join(__dirname, "../_test_files/single/case0/input.yaml"), sampleContainerType);
yamlToSSZ(path.join(__dirname, "../_test_files/single/case0/output.yaml"), ssz.UintNum64);
yamlToSSZ(path.join(__dirname, "../_test_files/single/case1/input.yaml"), sampleContainerType);
yamlToSSZ(path.join(__dirname, "../_test_files/single/case1/output.yaml"), ssz.UintNum64);
});

after(() => {
afterAll(() => {
fs.unlinkSync(path.join(__dirname, "../_test_files/single/case0/input.ssz"));
fs.unlinkSync(path.join(__dirname, "../_test_files/single/case0/output.ssz"));
fs.unlinkSync(path.join(__dirname, "../_test_files/single/case1/input.ssz"));
Expand Down
2 changes: 2 additions & 0 deletions packages/spec-test-util/test/globalSetup.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
export async function setup(): Promise<void> {}
export async function teardown(): Promise<void> {}
11 changes: 11 additions & 0 deletions packages/spec-test-util/vitest.config.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
import {defineConfig, mergeConfig} from "vitest/config";
import vitestConfig from "../../vitest.base.config";

export default mergeConfig(
vitestConfig,
defineConfig({
test: {
globalSetup: ["./test/globalSetup.ts"],
},
})
);
Loading

1 comment on commit 4996f4d

@github-actions
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Performance Alert ⚠️

Possible performance regression was detected for some benchmarks.
Benchmark result of this commit is worse than the previous benchmark result exceeding threshold.

Benchmark suite Current: 4996f4d Previous: 098d35a Ratio
getExpectedWithdrawals 250000 eb:0.95,eth1:0.7,we:0.05,wn:0,smpl:18 21.229 us/op 7.0010 us/op 3.03
Full benchmark results
Benchmark suite Current: 4996f4d Previous: 098d35a Ratio
getPubkeys - index2pubkey - req 1000 vs - 250000 vc 654.94 us/op 888.87 us/op 0.74
getPubkeys - validatorsArr - req 1000 vs - 250000 vc 82.541 us/op 81.806 us/op 1.01
BLS verify - blst-native 1.2967 ms/op 1.2765 ms/op 1.02
BLS verifyMultipleSignatures 3 - blst-native 2.7177 ms/op 2.6851 ms/op 1.01
BLS verifyMultipleSignatures 8 - blst-native 5.9711 ms/op 5.8816 ms/op 1.02
BLS verifyMultipleSignatures 32 - blst-native 21.800 ms/op 21.530 ms/op 1.01
BLS verifyMultipleSignatures 64 - blst-native 42.940 ms/op 42.411 ms/op 1.01
BLS verifyMultipleSignatures 128 - blst-native 85.215 ms/op 84.174 ms/op 1.01
BLS deserializing 10000 signatures 943.73 ms/op 897.12 ms/op 1.05
BLS deserializing 100000 signatures 9.4984 s/op 9.0524 s/op 1.05
BLS verifyMultipleSignatures - same message - 3 - blst-native 1.3292 ms/op 1.2609 ms/op 1.05
BLS verifyMultipleSignatures - same message - 8 - blst-native 1.5098 ms/op 1.5241 ms/op 0.99
BLS verifyMultipleSignatures - same message - 32 - blst-native 2.3253 ms/op 2.1958 ms/op 1.06
BLS verifyMultipleSignatures - same message - 64 - blst-native 4.4429 ms/op 4.2555 ms/op 1.04
BLS verifyMultipleSignatures - same message - 128 - blst-native 7.7180 ms/op 7.3021 ms/op 1.06
BLS aggregatePubkeys 32 - blst-native 25.639 us/op 26.835 us/op 0.96
BLS aggregatePubkeys 128 - blst-native 100.69 us/op 96.919 us/op 1.04
getAttestationsForBlock 50.509 ms/op 43.893 ms/op 1.15
getSlashingsAndExits - default max 148.91 us/op 167.21 us/op 0.89
getSlashingsAndExits - 2k 431.63 us/op 362.90 us/op 1.19
proposeBlockBody type=full, size=empty 4.9741 ms/op 4.9525 ms/op 1.00
isKnown best case - 1 super set check 311.00 ns/op 322.00 ns/op 0.97
isKnown normal case - 2 super set checks 300.00 ns/op 292.00 ns/op 1.03
isKnown worse case - 16 super set checks 302.00 ns/op 280.00 ns/op 1.08
CheckpointStateCache - add get delete 4.8910 us/op 5.5280 us/op 0.88
validate api signedAggregateAndProof - struct 2.6771 ms/op 2.7344 ms/op 0.98
validate gossip signedAggregateAndProof - struct 2.7574 ms/op 2.7392 ms/op 1.01
validate gossip attestation - vc 640000 1.3672 ms/op 1.3155 ms/op 1.04
batch validate gossip attestation - vc 640000 - chunk 32 167.82 us/op 156.51 us/op 1.07
batch validate gossip attestation - vc 640000 - chunk 64 155.40 us/op 136.96 us/op 1.13
batch validate gossip attestation - vc 640000 - chunk 128 152.14 us/op 126.47 us/op 1.20
batch validate gossip attestation - vc 640000 - chunk 256 152.88 us/op 129.92 us/op 1.18
pickEth1Vote - no votes 1.6087 ms/op 1.1328 ms/op 1.42
pickEth1Vote - max votes 13.041 ms/op 10.212 ms/op 1.28
pickEth1Vote - Eth1Data hashTreeRoot value x2048 20.877 ms/op 21.411 ms/op 0.98
pickEth1Vote - Eth1Data hashTreeRoot tree x2048 35.127 ms/op 27.950 ms/op 1.26
pickEth1Vote - Eth1Data fastSerialize value x2048 709.23 us/op 574.72 us/op 1.23
pickEth1Vote - Eth1Data fastSerialize tree x2048 7.8269 ms/op 6.7798 ms/op 1.15
bytes32 toHexString 605.00 ns/op 492.00 ns/op 1.23
bytes32 Buffer.toString(hex) 300.00 ns/op 281.00 ns/op 1.07
bytes32 Buffer.toString(hex) from Uint8Array 460.00 ns/op 417.00 ns/op 1.10
bytes32 Buffer.toString(hex) + 0x 296.00 ns/op 279.00 ns/op 1.06
Object access 1 prop 0.16200 ns/op 0.15500 ns/op 1.05
Map access 1 prop 0.15200 ns/op 0.13100 ns/op 1.16
Object get x1000 7.5290 ns/op 7.6080 ns/op 0.99
Map get x1000 0.80400 ns/op 0.71600 ns/op 1.12
Object set x1000 53.292 ns/op 48.308 ns/op 1.10
Map set x1000 42.758 ns/op 36.982 ns/op 1.16
Return object 10000 times 0.24570 ns/op 0.22620 ns/op 1.09
Throw Error 10000 times 4.1038 us/op 3.6822 us/op 1.11
fastMsgIdFn sha256 / 200 bytes 3.5400 us/op 3.1060 us/op 1.14
fastMsgIdFn h32 xxhash / 200 bytes 334.00 ns/op 265.00 ns/op 1.26
fastMsgIdFn h64 xxhash / 200 bytes 393.00 ns/op 323.00 ns/op 1.22
fastMsgIdFn sha256 / 1000 bytes 12.113 us/op 10.945 us/op 1.11
fastMsgIdFn h32 xxhash / 1000 bytes 487.00 ns/op 395.00 ns/op 1.23
fastMsgIdFn h64 xxhash / 1000 bytes 475.00 ns/op 392.00 ns/op 1.21
fastMsgIdFn sha256 / 10000 bytes 107.84 us/op 99.916 us/op 1.08
fastMsgIdFn h32 xxhash / 10000 bytes 2.0720 us/op 1.8590 us/op 1.11
fastMsgIdFn h64 xxhash / 10000 bytes 1.4690 us/op 1.2660 us/op 1.16
send data - 1000 256B messages 22.902 ms/op 18.371 ms/op 1.25
send data - 1000 512B messages 30.736 ms/op 27.519 ms/op 1.12
send data - 1000 1024B messages 45.612 ms/op 39.244 ms/op 1.16
send data - 1000 1200B messages 43.671 ms/op 35.531 ms/op 1.23
send data - 1000 2048B messages 47.834 ms/op 42.203 ms/op 1.13
send data - 1000 4096B messages 48.963 ms/op 38.492 ms/op 1.27
send data - 1000 16384B messages 143.73 ms/op 115.46 ms/op 1.24
send data - 1000 65536B messages 599.15 ms/op 491.72 ms/op 1.22
enrSubnets - fastDeserialize 64 bits 2.4040 us/op 1.2300 us/op 1.95
enrSubnets - ssz BitVector 64 bits 774.00 ns/op 412.00 ns/op 1.88
enrSubnets - fastDeserialize 4 bits 256.00 ns/op 164.00 ns/op 1.56
enrSubnets - ssz BitVector 4 bits 554.00 ns/op 411.00 ns/op 1.35
prioritizePeers score -10:0 att 32-0.1 sync 2-0 131.24 us/op 99.463 us/op 1.32
prioritizePeers score 0:0 att 32-0.25 sync 2-0.25 175.34 us/op 124.24 us/op 1.41
prioritizePeers score 0:0 att 32-0.5 sync 2-0.5 246.40 us/op 159.19 us/op 1.55
prioritizePeers score 0:0 att 64-0.75 sync 4-0.75 376.31 us/op 282.49 us/op 1.33
prioritizePeers score 0:0 att 64-1 sync 4-1 396.08 us/op 332.88 us/op 1.19
array of 16000 items push then shift 1.7145 us/op 1.5714 us/op 1.09
LinkedList of 16000 items push then shift 9.4860 ns/op 8.8190 ns/op 1.08
array of 16000 items push then pop 62.789 ns/op 70.913 ns/op 0.89
LinkedList of 16000 items push then pop 9.3490 ns/op 8.6040 ns/op 1.09
array of 24000 items push then shift 2.5178 us/op 2.3384 us/op 1.08
LinkedList of 24000 items push then shift 9.3950 ns/op 8.7580 ns/op 1.07
array of 24000 items push then pop 118.54 ns/op 97.806 ns/op 1.21
LinkedList of 24000 items push then pop 8.8930 ns/op 8.5670 ns/op 1.04
intersect bitArray bitLen 8 6.5390 ns/op 6.2680 ns/op 1.04
intersect array and set length 8 63.667 ns/op 60.829 ns/op 1.05
intersect bitArray bitLen 128 34.356 ns/op 33.197 ns/op 1.03
intersect array and set length 128 868.13 ns/op 838.91 ns/op 1.03
bitArray.getTrueBitIndexes() bitLen 128 1.5640 us/op 1.3520 us/op 1.16
bitArray.getTrueBitIndexes() bitLen 248 2.6600 us/op 2.4010 us/op 1.11
bitArray.getTrueBitIndexes() bitLen 512 5.0530 us/op 4.5520 us/op 1.11
Buffer.concat 32 items 945.00 ns/op 963.00 ns/op 0.98
Uint8Array.set 32 items 1.6720 us/op 2.0480 us/op 0.82
Set add up to 64 items then delete first 4.3374 us/op 4.1959 us/op 1.03
OrderedSet add up to 64 items then delete first 5.5145 us/op 5.3522 us/op 1.03
Set add up to 64 items then delete last 4.7427 us/op 4.5169 us/op 1.05
OrderedSet add up to 64 items then delete last 5.8024 us/op 5.7226 us/op 1.01
Set add up to 64 items then delete middle 5.1844 us/op 4.4896 us/op 1.15
OrderedSet add up to 64 items then delete middle 7.7735 us/op 6.8868 us/op 1.13
Set add up to 128 items then delete first 10.826 us/op 9.1514 us/op 1.18
OrderedSet add up to 128 items then delete first 14.322 us/op 12.073 us/op 1.19
Set add up to 128 items then delete last 9.7898 us/op 9.0686 us/op 1.08
OrderedSet add up to 128 items then delete last 14.595 us/op 11.341 us/op 1.29
Set add up to 128 items then delete middle 10.216 us/op 8.9844 us/op 1.14
OrderedSet add up to 128 items then delete middle 19.317 us/op 16.622 us/op 1.16
Set add up to 256 items then delete first 21.439 us/op 18.215 us/op 1.18
OrderedSet add up to 256 items then delete first 28.109 us/op 24.649 us/op 1.14
Set add up to 256 items then delete last 20.286 us/op 17.833 us/op 1.14
OrderedSet add up to 256 items then delete last 23.795 us/op 22.833 us/op 1.04
Set add up to 256 items then delete middle 18.747 us/op 17.903 us/op 1.05
OrderedSet add up to 256 items then delete middle 50.837 us/op 44.007 us/op 1.16
transfer serialized Status (84 B) 2.0870 us/op 1.7650 us/op 1.18
copy serialized Status (84 B) 1.8060 us/op 1.4630 us/op 1.23
transfer serialized SignedVoluntaryExit (112 B) 2.2520 us/op 1.9200 us/op 1.17
copy serialized SignedVoluntaryExit (112 B) 1.8540 us/op 1.5010 us/op 1.24
transfer serialized ProposerSlashing (416 B) 3.4560 us/op 2.3260 us/op 1.49
copy serialized ProposerSlashing (416 B) 3.3960 us/op 2.1790 us/op 1.56
transfer serialized Attestation (485 B) 3.0670 us/op 2.4240 us/op 1.27
copy serialized Attestation (485 B) 2.4670 us/op 2.1480 us/op 1.15
transfer serialized AttesterSlashing (33232 B) 2.2750 us/op 2.7670 us/op 0.82
copy serialized AttesterSlashing (33232 B) 5.3650 us/op 5.6870 us/op 0.94
transfer serialized Small SignedBeaconBlock (128000 B) 2.5540 us/op 3.1460 us/op 0.81
copy serialized Small SignedBeaconBlock (128000 B) 14.110 us/op 13.742 us/op 1.03
transfer serialized Avg SignedBeaconBlock (200000 B) 2.9510 us/op 3.1660 us/op 0.93
copy serialized Avg SignedBeaconBlock (200000 B) 20.553 us/op 61.172 us/op 0.34
transfer serialized BlobsSidecar (524380 B) 3.0710 us/op 3.4140 us/op 0.90
copy serialized BlobsSidecar (524380 B) 90.819 us/op 143.30 us/op 0.63
transfer serialized Big SignedBeaconBlock (1000000 B) 3.1330 us/op 3.3340 us/op 0.94
copy serialized Big SignedBeaconBlock (1000000 B) 161.60 us/op 289.61 us/op 0.56
pass gossip attestations to forkchoice per slot 3.8358 ms/op 4.0072 ms/op 0.96
forkChoice updateHead vc 100000 bc 64 eq 0 764.00 us/op 672.26 us/op 1.14
forkChoice updateHead vc 600000 bc 64 eq 0 4.3674 ms/op 4.1098 ms/op 1.06
forkChoice updateHead vc 1000000 bc 64 eq 0 7.5358 ms/op 6.9299 ms/op 1.09
forkChoice updateHead vc 600000 bc 320 eq 0 4.3322 ms/op 4.0727 ms/op 1.06
forkChoice updateHead vc 600000 bc 1200 eq 0 4.4062 ms/op 4.3032 ms/op 1.02
forkChoice updateHead vc 600000 bc 7200 eq 0 5.4064 ms/op 5.1962 ms/op 1.04
forkChoice updateHead vc 600000 bc 64 eq 1000 11.542 ms/op 11.016 ms/op 1.05
forkChoice updateHead vc 600000 bc 64 eq 10000 11.934 ms/op 11.799 ms/op 1.01
forkChoice updateHead vc 600000 bc 64 eq 300000 15.814 ms/op 15.713 ms/op 1.01
computeDeltas 500000 validators 300 proto nodes 6.5959 ms/op 6.4179 ms/op 1.03
computeDeltas 500000 validators 1200 proto nodes 6.5190 ms/op 6.3016 ms/op 1.03
computeDeltas 500000 validators 7200 proto nodes 6.6639 ms/op 6.1984 ms/op 1.08
computeDeltas 750000 validators 300 proto nodes 10.426 ms/op 9.5143 ms/op 1.10
computeDeltas 750000 validators 1200 proto nodes 10.399 ms/op 9.4484 ms/op 1.10
computeDeltas 750000 validators 7200 proto nodes 10.496 ms/op 9.6244 ms/op 1.09
computeDeltas 1400000 validators 300 proto nodes 19.628 ms/op 17.789 ms/op 1.10
computeDeltas 1400000 validators 1200 proto nodes 19.574 ms/op 18.136 ms/op 1.08
computeDeltas 1400000 validators 7200 proto nodes 19.642 ms/op 17.790 ms/op 1.10
computeDeltas 2100000 validators 300 proto nodes 29.553 ms/op 27.878 ms/op 1.06
computeDeltas 2100000 validators 1200 proto nodes 28.641 ms/op 27.713 ms/op 1.03
computeDeltas 2100000 validators 7200 proto nodes 27.617 ms/op 27.761 ms/op 0.99
computeProposerBoostScoreFromBalances 500000 validators 3.8012 ms/op 3.6677 ms/op 1.04
computeProposerBoostScoreFromBalances 750000 validators 3.7884 ms/op 3.6746 ms/op 1.03
computeProposerBoostScoreFromBalances 1400000 validators 3.7431 ms/op 3.6649 ms/op 1.02
computeProposerBoostScoreFromBalances 2100000 validators 3.7623 ms/op 3.6749 ms/op 1.02
altair processAttestation - 250000 vs - 7PWei normalcase 3.0572 ms/op 2.0848 ms/op 1.47
altair processAttestation - 250000 vs - 7PWei worstcase 3.7031 ms/op 3.1230 ms/op 1.19
altair processAttestation - setStatus - 1/6 committees join 183.71 us/op 140.95 us/op 1.30
altair processAttestation - setStatus - 1/3 committees join 378.55 us/op 269.85 us/op 1.40
altair processAttestation - setStatus - 1/2 committees join 492.90 us/op 371.26 us/op 1.33
altair processAttestation - setStatus - 2/3 committees join 624.55 us/op 469.22 us/op 1.33
altair processAttestation - setStatus - 4/5 committees join 856.53 us/op 664.21 us/op 1.29
altair processAttestation - setStatus - 100% committees join 1.0060 ms/op 761.53 us/op 1.32
altair processBlock - 250000 vs - 7PWei normalcase 11.624 ms/op 9.6696 ms/op 1.20
altair processBlock - 250000 vs - 7PWei normalcase hashState 41.894 ms/op 37.358 ms/op 1.12
altair processBlock - 250000 vs - 7PWei worstcase 40.274 ms/op 37.292 ms/op 1.08
altair processBlock - 250000 vs - 7PWei worstcase hashState 100.88 ms/op 94.421 ms/op 1.07
phase0 processBlock - 250000 vs - 7PWei normalcase 2.8101 ms/op 2.4498 ms/op 1.15
phase0 processBlock - 250000 vs - 7PWei worstcase 33.987 ms/op 30.047 ms/op 1.13
altair processEth1Data - 250000 vs - 7PWei normalcase 712.29 us/op 575.48 us/op 1.24
getExpectedWithdrawals 250000 eb:1,eth1:1,we:0,wn:0,smpl:15 15.151 us/op 10.503 us/op 1.44
getExpectedWithdrawals 250000 eb:0.95,eth1:0.1,we:0.05,wn:0,smpl:219 91.606 us/op 49.470 us/op 1.85
getExpectedWithdrawals 250000 eb:0.95,eth1:0.3,we:0.05,wn:0,smpl:42 26.050 us/op 18.102 us/op 1.44
getExpectedWithdrawals 250000 eb:0.95,eth1:0.7,we:0.05,wn:0,smpl:18 21.229 us/op 7.0010 us/op 3.03
getExpectedWithdrawals 250000 eb:0.1,eth1:0.1,we:0,wn:0,smpl:1020 198.54 us/op 122.08 us/op 1.63
getExpectedWithdrawals 250000 eb:0.03,eth1:0.03,we:0,wn:0,smpl:11777 1.3579 ms/op 1.4374 ms/op 0.94
getExpectedWithdrawals 250000 eb:0.01,eth1:0.01,we:0,wn:0,smpl:16384 1.7997 ms/op 1.5396 ms/op 1.17
getExpectedWithdrawals 250000 eb:0,eth1:0,we:0,wn:0,smpl:16384 1.7029 ms/op 1.4982 ms/op 1.14
getExpectedWithdrawals 250000 eb:0,eth1:0,we:0,wn:0,nocache,smpl:16384 4.2100 ms/op 3.5953 ms/op 1.17
getExpectedWithdrawals 250000 eb:0,eth1:1,we:0,wn:0,smpl:16384 2.7917 ms/op 2.2686 ms/op 1.23
getExpectedWithdrawals 250000 eb:0,eth1:1,we:0,wn:0,nocache,smpl:16384 5.6519 ms/op 5.0290 ms/op 1.12
Tree 40 250000 create 477.48 ms/op 353.78 ms/op 1.35
Tree 40 250000 get(125000) 229.56 ns/op 192.00 ns/op 1.20
Tree 40 250000 set(125000) 1.1391 us/op 977.41 ns/op 1.17
Tree 40 250000 toArray() 24.086 ms/op 18.254 ms/op 1.32
Tree 40 250000 iterate all - toArray() + loop 24.689 ms/op 18.390 ms/op 1.34
Tree 40 250000 iterate all - get(i) 79.130 ms/op 64.565 ms/op 1.23
MutableVector 250000 create 16.436 ms/op 12.470 ms/op 1.32
MutableVector 250000 get(125000) 6.8740 ns/op 6.5210 ns/op 1.05
MutableVector 250000 set(125000) 426.16 ns/op 254.73 ns/op 1.67
MutableVector 250000 toArray() 4.8676 ms/op 3.1632 ms/op 1.54
MutableVector 250000 iterate all - toArray() + loop 5.0575 ms/op 3.2663 ms/op 1.55
MutableVector 250000 iterate all - get(i) 1.6392 ms/op 1.5162 ms/op 1.08
Array 250000 create 4.5028 ms/op 2.8420 ms/op 1.58
Array 250000 clone - spread 1.8375 ms/op 1.2547 ms/op 1.46
Array 250000 get(125000) 1.4780 ns/op 1.0420 ns/op 1.42
Array 250000 set(125000) 5.4860 ns/op 4.0770 ns/op 1.35
Array 250000 iterate all - loop 190.51 us/op 163.83 us/op 1.16
effectiveBalanceIncrements clone Uint8Array 300000 68.475 us/op 28.476 us/op 2.40
effectiveBalanceIncrements clone MutableVector 300000 475.00 ns/op 361.00 ns/op 1.32
effectiveBalanceIncrements rw all Uint8Array 300000 217.47 us/op 199.33 us/op 1.09
effectiveBalanceIncrements rw all MutableVector 300000 136.84 ms/op 80.980 ms/op 1.69
phase0 afterProcessEpoch - 250000 vs - 7PWei 119.92 ms/op 113.06 ms/op 1.06
phase0 beforeProcessEpoch - 250000 vs - 7PWei 57.795 ms/op 52.523 ms/op 1.10
altair processEpoch - mainnet_e81889 589.83 ms/op 500.78 ms/op 1.18
mainnet_e81889 - altair beforeProcessEpoch 93.505 ms/op 78.569 ms/op 1.19
mainnet_e81889 - altair processJustificationAndFinalization 20.074 us/op 14.959 us/op 1.34
mainnet_e81889 - altair processInactivityUpdates 6.2507 ms/op 5.7191 ms/op 1.09
mainnet_e81889 - altair processRewardsAndPenalties 63.797 ms/op 60.703 ms/op 1.05
mainnet_e81889 - altair processRegistryUpdates 4.3930 us/op 2.4840 us/op 1.77
mainnet_e81889 - altair processSlashings 466.00 ns/op 446.00 ns/op 1.04
mainnet_e81889 - altair processEth1DataReset 1.0740 us/op 484.00 ns/op 2.22
mainnet_e81889 - altair processEffectiveBalanceUpdates 1.4733 ms/op 1.4180 ms/op 1.04
mainnet_e81889 - altair processSlashingsReset 4.9370 us/op 4.0430 us/op 1.22
mainnet_e81889 - altair processRandaoMixesReset 7.3410 us/op 4.2190 us/op 1.74
mainnet_e81889 - altair processHistoricalRootsUpdate 895.00 ns/op 708.00 ns/op 1.26
mainnet_e81889 - altair processParticipationFlagUpdates 2.8500 us/op 1.8430 us/op 1.55
mainnet_e81889 - altair processSyncCommitteeUpdates 822.00 ns/op 683.00 ns/op 1.20
mainnet_e81889 - altair afterProcessEpoch 124.66 ms/op 116.77 ms/op 1.07
capella processEpoch - mainnet_e217614 2.0397 s/op 2.0613 s/op 0.99
mainnet_e217614 - capella beforeProcessEpoch 471.47 ms/op 482.87 ms/op 0.98
mainnet_e217614 - capella processJustificationAndFinalization 14.933 us/op 19.876 us/op 0.75
mainnet_e217614 - capella processInactivityUpdates 20.804 ms/op 21.052 ms/op 0.99
mainnet_e217614 - capella processRewardsAndPenalties 394.25 ms/op 402.56 ms/op 0.98
mainnet_e217614 - capella processRegistryUpdates 26.766 us/op 16.894 us/op 1.58
mainnet_e217614 - capella processSlashings 645.00 ns/op 540.00 ns/op 1.19
mainnet_e217614 - capella processEth1DataReset 482.00 ns/op 401.00 ns/op 1.20
mainnet_e217614 - capella processEffectiveBalanceUpdates 4.8076 ms/op 4.9395 ms/op 0.97
mainnet_e217614 - capella processSlashingsReset 4.1080 us/op 3.2420 us/op 1.27
mainnet_e217614 - capella processRandaoMixesReset 4.3640 us/op 4.6230 us/op 0.94
mainnet_e217614 - capella processHistoricalRootsUpdate 422.00 ns/op 510.00 ns/op 0.83
mainnet_e217614 - capella processParticipationFlagUpdates 2.0830 us/op 1.6520 us/op 1.26
mainnet_e217614 - capella afterProcessEpoch 318.62 ms/op 315.64 ms/op 1.01
phase0 processEpoch - mainnet_e58758 398.55 ms/op 436.42 ms/op 0.91
mainnet_e58758 - phase0 beforeProcessEpoch 109.62 ms/op 113.07 ms/op 0.97
mainnet_e58758 - phase0 processJustificationAndFinalization 14.697 us/op 14.567 us/op 1.01
mainnet_e58758 - phase0 processRewardsAndPenalties 54.967 ms/op 54.928 ms/op 1.00
mainnet_e58758 - phase0 processRegistryUpdates 10.270 us/op 8.9170 us/op 1.15
mainnet_e58758 - phase0 processSlashings 469.00 ns/op 415.00 ns/op 1.13
mainnet_e58758 - phase0 processEth1DataReset 412.00 ns/op 385.00 ns/op 1.07
mainnet_e58758 - phase0 processEffectiveBalanceUpdates 1.1557 ms/op 1.1442 ms/op 1.01
mainnet_e58758 - phase0 processSlashingsReset 3.0430 us/op 2.7360 us/op 1.11
mainnet_e58758 - phase0 processRandaoMixesReset 4.2100 us/op 4.1590 us/op 1.01
mainnet_e58758 - phase0 processHistoricalRootsUpdate 703.00 ns/op 391.00 ns/op 1.80
mainnet_e58758 - phase0 processParticipationRecordUpdates 4.0160 us/op 4.9290 us/op 0.81
mainnet_e58758 - phase0 afterProcessEpoch 96.985 ms/op 94.664 ms/op 1.02
phase0 processEffectiveBalanceUpdates - 250000 normalcase 1.4381 ms/op 1.3292 ms/op 1.08
phase0 processEffectiveBalanceUpdates - 250000 worstcase 0.5 1.9465 ms/op 1.9439 ms/op 1.00
altair processInactivityUpdates - 250000 normalcase 20.068 ms/op 30.144 ms/op 0.67
altair processInactivityUpdates - 250000 worstcase 20.914 ms/op 30.633 ms/op 0.68
phase0 processRegistryUpdates - 250000 normalcase 8.3700 us/op 9.5720 us/op 0.87
phase0 processRegistryUpdates - 250000 badcase_full_deposits 352.46 us/op 311.40 us/op 1.13
phase0 processRegistryUpdates - 250000 worstcase 0.5 140.16 ms/op 157.72 ms/op 0.89
altair processRewardsAndPenalties - 250000 normalcase 54.627 ms/op 63.425 ms/op 0.86
altair processRewardsAndPenalties - 250000 worstcase 52.718 ms/op 56.387 ms/op 0.93
phase0 getAttestationDeltas - 250000 normalcase 8.9057 ms/op 9.1089 ms/op 0.98
phase0 getAttestationDeltas - 250000 worstcase 8.7077 ms/op 8.9035 ms/op 0.98
phase0 processSlashings - 250000 worstcase 93.228 us/op 85.653 us/op 1.09
altair processSyncCommitteeUpdates - 250000 151.41 ms/op 149.30 ms/op 1.01
BeaconState.hashTreeRoot - No change 249.00 ns/op 255.00 ns/op 0.98
BeaconState.hashTreeRoot - 1 full validator 126.39 us/op 147.97 us/op 0.85
BeaconState.hashTreeRoot - 32 full validator 1.2602 ms/op 1.5379 ms/op 0.82
BeaconState.hashTreeRoot - 512 full validator 12.990 ms/op 16.716 ms/op 0.78
BeaconState.hashTreeRoot - 1 validator.effectiveBalance 182.68 us/op 208.62 us/op 0.88
BeaconState.hashTreeRoot - 32 validator.effectiveBalance 2.1434 ms/op 2.2623 ms/op 0.95
BeaconState.hashTreeRoot - 512 validator.effectiveBalance 26.438 ms/op 29.707 ms/op 0.89
BeaconState.hashTreeRoot - 1 balances 141.04 us/op 156.13 us/op 0.90
BeaconState.hashTreeRoot - 32 balances 1.2015 ms/op 1.3426 ms/op 0.89
BeaconState.hashTreeRoot - 512 balances 12.911 ms/op 11.820 ms/op 1.09
BeaconState.hashTreeRoot - 250000 balances 196.42 ms/op 225.34 ms/op 0.87
aggregationBits - 2048 els - zipIndexesInBitList 17.004 us/op 16.067 us/op 1.06
byteArrayEquals 32 75.039 ns/op 70.736 ns/op 1.06
Buffer.compare 32 55.910 ns/op 53.038 ns/op 1.05
byteArrayEquals 1024 2.0302 us/op 1.9314 us/op 1.05
Buffer.compare 1024 71.312 ns/op 68.500 ns/op 1.04
byteArrayEquals 16384 32.778 us/op 30.764 us/op 1.07
Buffer.compare 16384 246.56 ns/op 259.49 ns/op 0.95
byteArrayEquals 123687377 245.04 ms/op 232.04 ms/op 1.06
Buffer.compare 123687377 7.8327 ms/op 6.2015 ms/op 1.26
byteArrayEquals 32 - diff last byte 88.353 ns/op 71.372 ns/op 1.24
Buffer.compare 32 - diff last byte 58.705 ns/op 55.467 ns/op 1.06
byteArrayEquals 1024 - diff last byte 2.0742 us/op 2.0202 us/op 1.03
Buffer.compare 1024 - diff last byte 72.994 ns/op 71.718 ns/op 1.02
byteArrayEquals 16384 - diff last byte 34.083 us/op 32.211 us/op 1.06
Buffer.compare 16384 - diff last byte 254.34 ns/op 273.41 ns/op 0.93
byteArrayEquals 123687377 - diff last byte 262.84 ms/op 239.13 ms/op 1.10
Buffer.compare 123687377 - diff last byte 7.0740 ms/op 6.0965 ms/op 1.16
byteArrayEquals 32 - random bytes 5.3420 ns/op 5.1520 ns/op 1.04
Buffer.compare 32 - random bytes 61.517 ns/op 59.021 ns/op 1.04
byteArrayEquals 1024 - random bytes 5.3420 ns/op 5.0610 ns/op 1.06
Buffer.compare 1024 - random bytes 61.602 ns/op 58.590 ns/op 1.05
byteArrayEquals 16384 - random bytes 5.3450 ns/op 5.3160 ns/op 1.01
Buffer.compare 16384 - random bytes 61.261 ns/op 58.236 ns/op 1.05
byteArrayEquals 123687377 - random bytes 8.6500 ns/op 8.3200 ns/op 1.04
Buffer.compare 123687377 - random bytes 64.410 ns/op 61.650 ns/op 1.04
regular array get 100000 times 45.646 us/op 43.111 us/op 1.06
wrappedArray get 100000 times 45.469 us/op 43.048 us/op 1.06
arrayWithProxy get 100000 times 15.708 ms/op 14.020 ms/op 1.12
ssz.Root.equals 54.686 ns/op 52.358 ns/op 1.04
byteArrayEquals 54.260 ns/op 51.512 ns/op 1.05
Buffer.compare 12.019 ns/op 10.542 ns/op 1.14
shuffle list - 16384 els 7.1601 ms/op 6.9002 ms/op 1.04
shuffle list - 250000 els 105.06 ms/op 99.823 ms/op 1.05
processSlot - 1 slots 17.655 us/op 16.517 us/op 1.07
processSlot - 32 slots 3.2066 ms/op 3.5401 ms/op 0.91
getEffectiveBalanceIncrementsZeroInactive - 250000 vs - 7PWei 62.084 ms/op 60.992 ms/op 1.02
getCommitteeAssignments - req 1 vs - 250000 vc 2.5342 ms/op 2.4611 ms/op 1.03
getCommitteeAssignments - req 100 vs - 250000 vc 3.7344 ms/op 3.6420 ms/op 1.03
getCommitteeAssignments - req 1000 vs - 250000 vc 4.0840 ms/op 3.9976 ms/op 1.02
findModifiedValidators - 10000 modified validators 545.03 ms/op 559.22 ms/op 0.97
findModifiedValidators - 1000 modified validators 571.96 ms/op 425.51 ms/op 1.34
findModifiedValidators - 100 modified validators 553.88 ms/op 397.22 ms/op 1.39
findModifiedValidators - 10 modified validators 499.95 ms/op 372.77 ms/op 1.34
findModifiedValidators - 1 modified validators 499.10 ms/op 394.92 ms/op 1.26
findModifiedValidators - no difference 432.48 ms/op 403.22 ms/op 1.07
compare ViewDUs 4.6189 s/op 4.3589 s/op 1.06
compare each validator Uint8Array 1.8315 s/op 1.9616 s/op 0.93
compare ViewDU to Uint8Array 1.1654 s/op 1.1229 s/op 1.04
migrate state 1000000 validators, 24 modified, 0 new 797.98 ms/op 807.40 ms/op 0.99
migrate state 1000000 validators, 1700 modified, 1000 new 1.0414 s/op 1.1144 s/op 0.93
migrate state 1000000 validators, 3400 modified, 2000 new 1.3534 s/op 1.3544 s/op 1.00
migrate state 1500000 validators, 24 modified, 0 new 875.57 ms/op 818.38 ms/op 1.07
migrate state 1500000 validators, 1700 modified, 1000 new 1.2805 s/op 1.1023 s/op 1.16
migrate state 1500000 validators, 3400 modified, 2000 new 1.3130 s/op 1.3207 s/op 0.99
RootCache.getBlockRootAtSlot - 250000 vs - 7PWei 4.4000 ns/op 4.0900 ns/op 1.08
state getBlockRootAtSlot - 250000 vs - 7PWei 551.20 ns/op 706.77 ns/op 0.78
computeProposers - vc 250000 9.0674 ms/op 9.2365 ms/op 0.98
computeEpochShuffling - vc 250000 103.39 ms/op 101.63 ms/op 1.02
getNextSyncCommittee - vc 250000 150.31 ms/op 154.61 ms/op 0.97
computeSigningRoot for AttestationData 25.683 us/op 27.064 us/op 0.95
hash AttestationData serialized data then Buffer.toString(base64) 2.2791 us/op 2.2756 us/op 1.00
toHexString serialized data 1.0609 us/op 1.0751 us/op 0.99
Buffer.toString(base64) 217.02 ns/op 217.78 ns/op 1.00

Please sign in to comment.