Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: update the performance tests to use @chainsafe/benchmark #7373

Draft
wants to merge 15 commits into
base: unstable
Choose a base branch
from

Conversation

nazarhussain
Copy link
Contributor

Motivation

Use the @chainsafe/benchmark fork for our performance tests. This will enable to run these tests on multiple JS runtimes.

Description

  • Update the packages
  • Update tests files

Steps to test or reproduce

  • Run all tests

@nazarhussain nazarhussain requested a review from a team as a code owner January 17, 2025 15:51
Copy link

codecov bot commented Jan 17, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 50.39%. Comparing base (06831cf) to head (627c7a5).
Report is 3 commits behind head on unstable.

Additional details and impacted files
@@             Coverage Diff              @@
##           unstable    #7373      +/-   ##
============================================
+ Coverage     48.62%   50.39%   +1.77%     
============================================
  Files           603      603              
  Lines         40516    40510       -6     
  Branches       2071     2208     +137     
============================================
+ Hits          19700    20417     +717     
+ Misses        20778    20053     -725     
- Partials         38       40       +2     

Comment on lines +62 to +65

// TODO: Diagnose why this benchmark failing after upgrade
// https://github.com/ChainSafe/lodestar/issues/7380
bench.skip({
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Only this benchmark is failing, need to troubleshoot in particular later on.

Copy link
Member

@matthewkeil matthewkeil left a comment

Choose a reason for hiding this comment

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

Just a couple small questions but looks good overall

@@ -38,7 +38,7 @@ describe("validate gossip attestation", () => {
state,
bitIndex: i,
});
expect(subnet).to.be.equal(subnet0);
assert.deepEqual(subnet, subnet0);
Copy link
Member

Choose a reason for hiding this comment

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

It seems weird that we need to use assert here...

Comment on lines -37 to -45
it("ArrayBuffer use after structuredClone transfer", () => {
const data = new Uint8Array(32);
data[0] = 1;
expect(data[0]).equals(1);
structuredClone(data, {transfer: [data.buffer]});
// After structuredClone() data is mutated in place to hold an empty ArrayBuffer
expect(data[0]).equals(undefined);
expect(data).deep.equals(new Uint8Array());
});
Copy link
Member

Choose a reason for hiding this comment

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

Did this get moved to a unit test or something?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Looked closely and my observation was that it's not that useful test case. So removed it.

Comment on lines -27 to -32
it("Check is correct", () => {
for (const i of [0, 1, Math.floor(n / 2)]) {
expect(array[i]).to.equal(i, `Wrong value array[${i}]`);
expect(arrayWithProxy[i]).to.equal(i, `Wrong value arrayWithProxy[${i}]`);
}
});
Copy link
Member

Choose a reason for hiding this comment

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

Did this get moved to a unit test?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Same as above.

This reverts commit 8a0e51d.
@nflaig
Copy link
Member

nflaig commented Jan 21, 2025

It would be good to figure out #7380 before merging this

@nflaig
Copy link
Member

nflaig commented Jan 21, 2025

there is no benchmark report / comment on this PR, this is no longer supported or just broken?

@nazarhussain
Copy link
Contributor Author

there is no benchmark report / comment on this PR, this is no longer supported or just broken?

Already looking into it.

@nazarhussain nazarhussain marked this pull request as draft January 21, 2025 15:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants