Commit d612ffa
perf: offload BeautifulSoup parsing to a thread via
## Summary
- `BeautifulSoup()` constructor performs synchronous HTML parsing that
blocks the event loop, degrading concurrency.
- Wrapped `parse()` and `parse_text()` in `asyncio.to_thread()` to
offload parsing to a worker thread, consistent with how
`ParselParser.parse()` already works.
---
Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>asyncio.to_thread (#1817)1 parent 905ed56 commit d612ffa
1 file changed
+4
-2
lines changedLines changed: 4 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
| 3 | + | |
3 | 4 | | |
4 | 5 | | |
5 | 6 | | |
| |||
23 | 24 | | |
24 | 25 | | |
25 | 26 | | |
26 | | - | |
| 27 | + | |
| 28 | + | |
27 | 29 | | |
28 | 30 | | |
29 | 31 | | |
30 | | - | |
| 32 | + | |
31 | 33 | | |
32 | 34 | | |
33 | 35 | | |
| |||
0 commit comments