Skip to content

Performance: Testing - time Buy/Sell/Swap coin lists and quotes with spans - #2476

Open
JohnathanWhite wants to merge 2 commits into
bitpay:developfrom
JohnathanWhite:perf/buy-sell-swap
Open

JohnathanWhite wants to merge 2 commits into
bitpay:developfrom
JohnathanWhite:perf/buy-sell-swap

Conversation

@JohnathanWhite

@JohnathanWhite JohnathanWhite commented Oct 21, 2026 •

Copy link
Copy Markdown
Collaborator

Stacked on #2507. Its commit appears here until it lands; this PR is the one commit after it (4 files, +18).

Summary

This PR originally carried the whole Buy/Sell/Swap perf effort, stacked on #2475. Since then #2475 merged, the product-code half merged as #2506, and the harness half is #2507. What is left is the instrumentation both omitted: the spanStart/spanEnd calls that the trade scenarios and perf/loop/FINDINGS-trade.md in #2507 rely on. Without them nothing emits the six spans those scenarios report.

The branch was rebuilt on current develop; the previous head is 1937172.

Changes

  • BuyCurrencies / SellCurrencies / SwapCurrencies: init start until the supported-coin list is set.
  • BuyQuotes / SellQuotes / SwapQuotes: quote round requested (including the debounce) until the best offer is selected, or every provider has answered with no usable offer.

Spans are no-ops unless the build has IS_PERF=true. No behaviour change.

Known gaps

  • Spans end only on success. A failed coin-list init, or a Sell best offer with a zero amount, leaves the span open and reports no sample for that round.
  • The span API in PerfMonitor.ts has no unit tests.

Testing

  • Type-check: no new errors against develop (yarn validate passes)
  • Lint: no new findings on the touched files
  • Jest for src/navigation/services and src/perf: 13 tests pass (none exercises the spans)
  • Perf-build run of trade_buy / trade_sell / trade_swap showing the six spans

Jira: RN-3106

Adds the trade-flow half of the performance harness on top of the perf
framework from bitpay#2475: Maestro scenarios that drive Buy, Sell and Swap
read-only (quotes load, nothing is confirmed, signed or submitted),
per-scenario accepted runs and per-screen transition comparisons, a
JS-CPU flow profiler, the process-memory mode recorded per run, and the
trade findings.

- perf/scenarios/trade_{buy,sell,swap}.yaml - the three flows.
- perf/loop/flowprofile.sh - JS CPU profile of a flow.
- perf/loop/FINDINGS-trade.md - root causes, baselines, parked items.
- perf/{cli,collector,config,compare,drivers/android,iterate} - per-scenario
  runs, coin-list and quote spans, memory-mode recording.
- src/perf/PerfMonitor.ts - spanStart/spanEnd for sub-screen timing.
- Android PerfMarks/MainApplication - non-perf builds compile against the
  new startJsProfiler(context); perf marks for the profiler.

Jira: RN-3106
…spans

Wire the PerfMonitor span API into the trade screens so the perf harness can
report how long each flow takes to become usable, as pseudo-screens in the
per-screen transitions:

- BuyCurrencies / SellCurrencies / SwapCurrencies: init start until the
  supported-coin list is set.
- BuyQuotes / SellQuotes / SwapQuotes: quote round requested (including the
  debounce) until the best offer is selected, or until every provider has
  answered with no usable offer.

spanStart/spanEnd return immediately unless the build has IS_PERF=true, so
release builds are unaffected. No change to what the screens do.

These are the spans the trade scenarios and FINDINGS-trade.md numbers were
measured with; they were left out when the product changes (bitpay#2506) and the
harness (bitpay#2507) were split out of bitpay#2476.
@JohnathanWhite JohnathanWhite changed the title Buy/Sell/Swap: perf - faster coin lists and best-offer selection Performance: Testing - time Buy/Sell/Swap coin lists and quotes with spans Nov 17, 2026
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.

1 participant