You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: yarn-project/p2p/src/client/test/p2p_client.batch_tx_requester.bench.README.md
+23-53Lines changed: 23 additions & 53 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,6 +1,6 @@
1
-
# ProposalTxCollector Benchmarks
1
+
# BatchTxRequester Benchmarks
2
2
3
-
This benchmark suite measures **how quickly a proposer node can fetch missing transactions from P2P peers** when building a block proposal. It compares two alternative transaction-collection implementations under several controlled "who-has-which-txs" distributions.
3
+
This benchmark suite measures **how quickly a proposer node can fetch missing transactions from P2P peers** when building a block proposal under several controlled "who-has-which-txs" distributions.
4
4
5
5
## Purpose
6
6
@@ -10,12 +10,6 @@ This benchmark answers:
10
10
11
11
- How long does it take to fetch **N missing txs** (N ∈ **{10, 50, 100, 500}**)?
12
12
- How do different **peer availability patterns** affect performance?
13
-
- Which collector strategy performs better under each pattern?
@@ -175,14 +147,14 @@ Writes the pretty table + summary to disk.
175
147
176
148
For each case the benchmark records:
177
149
178
-
-`durationMs`: wall-clock time spent inside the collector call
179
-
-`fetchedCount`: how many txs were returned by the collector
150
+
-`durationMs`: wall-clock time spent inside the requester call
151
+
-`fetchedCount`: how many txs were returned by the requester
180
152
-`success`: `fetchedCount === missingTxCount`
181
153
182
154
**Guidelines:**
183
155
184
156
-**Always check `Success` first.** A faster run that fetched fewer txs is not a win.
185
-
- Compare collectors**within the same distribution + missing count** only.
157
+
- Compare runs**within the same distribution + missing count** only.
186
158
- Expect `pinned-only` to highlight pinned-peer behavior (fast if pinned peer is used effectively; slow if the algorithm wastes time sampling other peers).
187
159
- Expect `sparse` to be the most "network-like" stress case, since many peers won't have each requested tx.
188
160
@@ -193,7 +165,7 @@ Inside each worker, the benchmark intentionally reduces variability:
193
165
-**Unlimited rate limits** are installed so the req/resp rate limiter doesn't dominate results
194
166
-**Deterministic tx generation** ensures all workers see the same tx set without large IPC payloads
195
167
196
-
This makes the benchmark better for *comparing collectors* (A vs B), but it is **not** a perfect model of production networking conditions.
168
+
This makes the benchmark better for tracking regressions, but it is **not** a perfect model of production networking conditions.
197
169
198
170
## Limitations
199
171
@@ -207,9 +179,7 @@ This benchmark does **not** measure:
207
179
208
180
| File | Purpose |
209
181
|------|---------|
210
-
|`p2p_client.proposal_tx_collector.bench.test.ts`| Test suite (cases, distributions, output formatting) |
0 commit comments