Skip to content

perf(login): add temporary aggregate3 codec benchmark - #38132

Closed
Prithpal-Sooriya wants to merge 1 commit into
mainfrom
perf/aggregate3-codec-hermes-poc
Closed

Prithpal-Sooriya wants to merge 1 commit into
mainfrom
perf/aggregate3-codec-hermes-poc

Conversation

@Prithpal-Sooriya

Copy link
Copy Markdown
Contributor

Description

Temporary dev-only harness for comparing Multicall3 aggregate3 codecs on Hermes, ahead of MetaMask/core#11010.

The hand-rolled, viem, and stock Ethers codecs are copied into the app. A __DEV__ button on the login screen times a realistic 300-call balance batch and logs AGGREGATE3_BENCH. Measured results for a Xiaomi phone and an arm64 Android emulator, including a 1-CPU emulator run, are in docs/performance/aggregate3-codec-android.md.

This does not change production balance fetching. It is marked DO-NOT-MERGE so it can be dropped once the codec choice is settled.

Changelog

CHANGELOG entry: null

Related issues

Fixes:

Refs: MetaMask/core#11010

Manual testing steps

Feature: aggregate3 codec benchmark

  Scenario: developer times the three codecs on login
    Given a dev build is attached to Metro
    And the login screen is visible

    When the developer taps "Benchmark aggregate3 (300)"
    Then the screen shows full-path milliseconds for ethers, viem, and handrolled
    And Metro logs a warning starting with AGGREGATE3_BENCH

Screenshots/Recordings

Before

N/A

After

N/A

On-device numbers are in docs/performance/aggregate3-codec-android.md.

Pre-merge author checklist

Performance checks (if applicable)

  • I've tested on Android
    • Ideally on a mid-range device; emulator is acceptable
  • I've tested with a power user scenario
    • Use these power-user SRPs to import wallets with many accounts and tokens
  • I've instrumented key operations with Sentry traces for production performance metrics

For performance guidelines and tooling, see the Performance Guide.

Pre-merge reviewer checklist

  • I've manually tested the PR (e.g. pull and build branch, run the app, test code being changed).
  • I confirm that this PR addresses all acceptance criteria described in the ticket it closes and includes the necessary testing evidence such as recordings and or screenshots.

Made with Cursor

Copy the core aggregate3 codecs into a dev-only login control so a 300-call batch can be timed on Hermes before the production change.

Co-authored-by: Cursor <cursoragent@cursor.com>
@Prithpal-Sooriya Prithpal-Sooriya added the DO-NOT-MERGE Pull requests that should not be merged label Oct 23, 2026
@Prithpal-Sooriya Prithpal-Sooriya self-assigned this Oct 23, 2026
@github-actions

Copy link
Copy Markdown
Contributor

CLA Signature Action: All authors have signed the CLA. You may need to manually re-run the blocking PR check if it doesn't pass in a few minutes.

@github-actions

Copy link
Copy Markdown
Contributor

Smart E2E Test Selection

Selected E2E tags: No E2E tests selected

AI Confidence: 95

E2E reasoning

Expand to read

This PR adds a developer-only performance benchmarking tool for comparing aggregate3 ABI codecs (ethers vs viem vs handrolled). The key analysis points:

  1. Aggregate3CodecBenchmarkButton.tsx: The component explicitly returns null when !__DEV__, meaning it is completely invisible in production/release builds. E2E tests run against production builds, so this component will never appear during any smoke test run.

  2. LoginView.testIds.ts: Two new test ID constants were added (AGGREGATE3_BENCHMARK_BUTTON, AGGREGATE3_BENCHMARK_RESULT). These are additive-only changes and do not modify any existing selector constants used by E2E tests.

  3. Login/index.tsx: Only adds an import and renders the new Aggregate3CodecBenchmarkButton component. Since that component returns null in production, the Login view's production behavior is completely unchanged.

  4. app/core/Performance/multicallAggregate3Poc/: Pure benchmark utility files with no integration into any production code path. These are standalone measurement tools.

  5. runAggregate3CodecBenchmark.test.ts: Unit tests only, no E2E impact.

  6. docs/performance/aggregate3-codec-android.md: Documentation only.

No existing E2E test flows are affected. The Login screen behavior in production builds is identical to before. No shared components, controllers, state management, or navigation flows were modified. This is a purely additive, dev-only change with zero production blast radius.

Performance reasoning

Expand to read

The performance benchmark utilities added in this PR (runAggregate3CodecBenchmark.ts, aggregate3Codecs.ts, aggregate3Handrolled.ts) are standalone measurement tools that are not integrated into any production code path. They are only accessible via the dev-only Aggregate3CodecBenchmarkButton (which returns null in production). None of the available performance test tags (@PerformanceLogin, @PerformanceLaunch, etc.) are relevant here because the Login screen's production behavior is unchanged. The benchmark code does not affect app startup, login flow timing, asset loading, or any other measured performance scenario. No performance test tags should run.

View run

@Prithpal-Sooriya Prithpal-Sooriya added the experiment Spike or experiment. Closed after 7 days without updates; branch is kept. label Nov 10, 2026
@Prithpal-Sooriya

Copy link
Copy Markdown
Contributor Author

Closing this experiment: no commits in 7 days. The branch is still there if you want to reopen it.

@github-actions github-actions Bot locked and limited conversation to collaborators Nov 10, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

DO-NOT-MERGE Pull requests that should not be merged experiment Spike or experiment. Closed after 7 days without updates; branch is kept. size-XL team-assets

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant