Description
Bug
jarvis serve takes 70+ seconds to start on a fast machine
(RTX 5090, 32-core CPU, NVMe SSD). GPU, CPU and network are
not the bottleneck.
Root Causes (three compounding issues)
1. SystemBuilder.build() runs twice (~30-40s)
serve.py builds engine, tools, databases, GPU monitor etc inline,
then calls SystemBuilder(config).build() again inside the scheduler
block — rebuilding everything from scratch a second time.
2. Engine discovery is serial (~10-20s)
discover_engines() health-checks 14 engines one by one, each
with a 2.0s timeout. On Windows, dead localhost ports trigger
IPv6→IPv4 fallback, making each failed probe slow. 14 × 2s = 28s
in the worst case.
3. check_for_updates() blocks startup (~3s)
Version check runs synchronously before the server starts.
Fix
- Reuse already-built components instead of calling SystemBuilder
again in the scheduler block
- Parallelise health probes with ThreadPoolExecutor, lower
localhost timeout from 2.0s to 0.5s
- Run check_for_updates() in a daemon thread
Result
Startup drops from ~70s to ~5-8s.
Environment
- Windows 11, NVIDIA RTX 5090
- OpenJarvis v0.1.1, Python 3.14
Steps to Reproduce
a
Expected Behavior
a
Actual Behavior
a
Operating System
Linux
Python Version
3.10
Hardware
NVIDIA GPU
Engine
None
Logs / Traceback
Description
Bug
jarvis servetakes 70+ seconds to start on a fast machine(RTX 5090, 32-core CPU, NVMe SSD). GPU, CPU and network are
not the bottleneck.
Root Causes (three compounding issues)
1. SystemBuilder.build() runs twice (~30-40s)
serve.py builds engine, tools, databases, GPU monitor etc inline,
then calls SystemBuilder(config).build() again inside the scheduler
block — rebuilding everything from scratch a second time.
2. Engine discovery is serial (~10-20s)
discover_engines() health-checks 14 engines one by one, each
with a 2.0s timeout. On Windows, dead localhost ports trigger
IPv6→IPv4 fallback, making each failed probe slow. 14 × 2s = 28s
in the worst case.
3. check_for_updates() blocks startup (~3s)
Version check runs synchronously before the server starts.
Fix
again in the scheduler block
localhost timeout from 2.0s to 0.5s
Result
Startup drops from ~70s to ~5-8s.
Environment
Steps to Reproduce
a
Expected Behavior
a
Actual Behavior
a
Operating System
Linux
Python Version
3.10
Hardware
NVIDIA GPU
Engine
None
Logs / Traceback