Commit 0f45d8d
committed
Parallelize ExCk return-type lookups in prewarm, hoist beam setup out of loop
Previously prewarmStructFieldsFromText made sequential ReturnTypeStruct
calls (2s timeout each) in a loop, also calling getBeamProcess+Ready
for every iteration. On files with many var=Mod.func() patterns, these
sequential calls could hold the BEAM process for extended periods while
a completion-triggered ReturnTypeStruct call waited behind them.
Changes:
- Fire all ExCk ReturnTypeStruct calls in parallel goroutines so they
complete as fast as the BEAM can process them, minimizing the window
where the prewarm contends with completion requests.
- Hoist getBeamProcess + Ready out of the loop — same BEAM process
for all calls, no need to look it up and check readiness per call.
- All ExCk calls share a single 2s context timeout instead of each
getting its own, preventing runaway goroutines.1 parent feb344e commit 0f45d8d
1 file changed
Lines changed: 38 additions & 31 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1515 | 1515 | | |
1516 | 1516 | | |
1517 | 1517 | | |
1518 | | - | |
| 1518 | + | |
1519 | 1519 | | |
1520 | 1520 | | |
1521 | 1521 | | |
| |||
1535 | 1535 | | |
1536 | 1536 | | |
1537 | 1537 | | |
1538 | | - | |
1539 | | - | |
1540 | | - | |
1541 | | - | |
1542 | | - | |
1543 | | - | |
1544 | | - | |
1545 | | - | |
1546 | | - | |
| 1538 | + | |
1547 | 1539 | | |
1548 | | - | |
1549 | | - | |
1550 | | - | |
1551 | | - | |
1552 | | - | |
1553 | | - | |
1554 | | - | |
1555 | | - | |
1556 | | - | |
1557 | | - | |
1558 | | - | |
| 1540 | + | |
| 1541 | + | |
| 1542 | + | |
| 1543 | + | |
| 1544 | + | |
| 1545 | + | |
| 1546 | + | |
| 1547 | + | |
| 1548 | + | |
| 1549 | + | |
| 1550 | + | |
| 1551 | + | |
| 1552 | + | |
| 1553 | + | |
| 1554 | + | |
| 1555 | + | |
| 1556 | + | |
| 1557 | + | |
| 1558 | + | |
| 1559 | + | |
| 1560 | + | |
| 1561 | + | |
| 1562 | + | |
| 1563 | + | |
| 1564 | + | |
| 1565 | + | |
| 1566 | + | |
| 1567 | + | |
| 1568 | + | |
| 1569 | + | |
| 1570 | + | |
| 1571 | + | |
| 1572 | + | |
| 1573 | + | |
| 1574 | + | |
| 1575 | + | |
1559 | 1576 | | |
1560 | | - | |
1561 | | - | |
1562 | | - | |
1563 | | - | |
1564 | | - | |
1565 | | - | |
1566 | | - | |
1567 | 1577 | | |
1568 | | - | |
1569 | | - | |
1570 | | - | |
1571 | 1578 | | |
1572 | 1579 | | |
1573 | 1580 | | |
| |||
0 commit comments