Skip to content

perf: jarvis serve takes 70s to start — duplicate SystemBuilder, serial engine probes, sync version check #263

@Graham-Tga

Description

@Graham-Tga

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

  1. Reuse already-built components instead of calling SystemBuilder
    again in the scheduler block
  2. Parallelise health probes with ThreadPoolExecutor, lower
    localhost timeout from 2.0s to 0.5s
  3. 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

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions