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: .jules/bolt.md
+4Lines changed: 4 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -9,3 +9,7 @@
9
9
## 2024-05-24 - [Thread Pool Size for Concurrent I/O]
10
10
**Learning:** Hardcoded, small thread pool limits (like `max_workers=50`) act as severe bottlenecks for highly I/O bound concurrent network tasks like ping sweeping an entire subnet. Because pings spend most of their time waiting on network timeouts, artificially restricting concurrency forces the pool to process timeouts in batches, drastically increasing total scan time.
11
11
**Action:** When using `concurrent.futures.ThreadPoolExecutor` for pure I/O or network tasks where the operation is mostly waiting, dynamically size `max_workers` to handle the full workload concurrently (e.g., `min(total_tasks, 256)`) to complete all timeouts in parallel.
12
+
13
+
## 2026-03-23 - [Subprocess PATH lookup overhead]
14
+
**Learning:** Calling `subprocess.call(["ping", ...])` without the absolute path causes the OS/Python interpreter to repeatedly scan through all directories listed in the `PATH` environment variable to locate the executable file for *every single* invocation. In highly concurrent or iterative loops (like a network sweep using `ThreadPoolExecutor`), this redundant lookup creates a measurable performance bottleneck.
15
+
**Action:** When invoking external commands repetitively via `subprocess` in a tight loop or concurrently, cache the absolute path of the executable once at module initialization using `shutil.which("command") or "command"` to eliminate `PATH` traversal overhead.
0 commit comments