* Build a large tree for performance testing.
(rowCount: number)
| 510 | * Build a large tree for performance testing. |
| 511 | */ |
| 512 | function buildLargeTree(rowCount: number): VNode { |
| 513 | const rows: VNode[] = []; |
| 514 | for (let i = 0; i < rowCount; i++) { |
| 515 | rows.push( |
| 516 | ui.row({}, [ |
| 517 | ui.button({ id: `btn-${i}`, label: `Button ${i}` }), |
| 518 | ui.input({ id: `input-${i}`, value: "" }), |
| 519 | ui.text(`Row ${i}`), |
| 520 | ]), |
| 521 | ); |
| 522 | } |
| 523 | return ui.column({}, rows); |
| 524 | } |
| 525 | |
| 526 | test("widgetMeta: collectAllWidgetMetadata performance - single traversal vs 6 separate", () => { |
| 527 | // Keep the workload large enough that timing noise doesn't dominate. |