Skip to content

Investigation: Gemini CLI Cold Start Latency (~15s) vs. Native Alternatives #255

@Joseph19820124

Description

@Joseph19820124

Problem Description

Gemini CLI currently suffers from a significant cold start latency (approximately 15 seconds), which is notably slower than alternative tools like Codex or Kiro CLI (which often start in < 1 second).

Investigation Findings

Our performance analysis reveals several key factors contributing to this delay:

  1. Architecture (Node.js vs. Native):

    • Competitive tools like Codex and Kiro use platform-specific native binaries (Rust/Go).
    • Gemini CLI is a pure Node.js application. Simple commands like gemini --version take ~2.8s just to initialize the Node runtime and parse basic modules, compared to 0.1s for native tools.
  2. Bundle Size and Parsing Overhead:

    • The total installation size of Gemini CLI is over 170MB.
    • Several JavaScript chunks exceed 14MB each. Synchronously reading and parsing these heavy bundles on startup creates a major bottleneck.
  3. Heavy Initialization Sequence:

    • The initializeApp function performs multiple synchronous/heavy tasks:
      • Auth Checks: performInitialAuth involves credential verification and environment loading.
      • Plugin/Extension Management: Checking for updates and loading all enabled extensions adds significant overhead.
      • MCP Server Discovery: Initializing the MCP server ecosystem and loading policies occurs before the prompt is ready.

Conclusion

This latency appears to be a structural trade-off of the current Node.js-based, feature-heavy architecture. While many of these features are essential for the agent's capabilities, the cold start performance remains a hurdle for quick CLI interactions.

This report was generated based on an automated codebase and performance investigation.

Metadata

Metadata

Assignees

No one assigned

    Labels

    geminip3Low — nice to have

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions