Skip to content

Conversation

@FrederikBolding
Copy link
Member

@FrederikBolding FrederikBolding commented Mar 28, 2025

Use a constant time lookup for typedUnion instead of .find() as this seems a little faster.

To make this work, I had to modify some of the legacy structs to use our own implementation of literal as otherwise struct.schema.type.type would be literal.

@codecov
Copy link

codecov bot commented Mar 28, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 94.99%. Comparing base (c1b55b0) to head (48ad9c6).
Report is 3 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #3275   +/-   ##
=======================================
  Coverage   94.98%   94.99%           
=======================================
  Files         511      511           
  Lines       11313    11328   +15     
  Branches     1741     1747    +6     
=======================================
+ Hits        10746    10761   +15     
  Misses        567      567           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@FrederikBolding FrederikBolding changed the title perf: Optimize structs perf: Optimize typedUnion Mar 28, 2025
@FrederikBolding
Copy link
Member Author

@metamaskbot update-pr

@FrederikBolding FrederikBolding marked this pull request as ready for review March 28, 2025 14:38
@FrederikBolding FrederikBolding requested a review from a team as a code owner March 28, 2025 14:38
@FrederikBolding
Copy link
Member Author

@metamaskbot update-pr

@FrederikBolding FrederikBolding added this pull request to the merge queue Mar 31, 2025
Merged via the queue into main with commit 9044621 Mar 31, 2025
172 checks passed
@FrederikBolding FrederikBolding deleted the fb/struct-perf branch March 31, 2025 12:39
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.

5 participants