Skip to content

[FEAT] Allow parallel execution for command modules #2045

@JOTSR

Description

@JOTSR

Description

Fastfetch currently executes command modules sequentially, even when they are independent and non-blocking. This can introduce noticeable latency when multiple commands are defined in the config. For example:

{
  "type": "command",
  "key": "│ {#35} editor     {#keys}│",
  "text": "%EDITOR% --version" // adds ~80ms
},
{
  "type": "command",
  "key": "│ {#35} visual     {#keys}│",
  "text": "echo %VISUAL%" // adds ~100ms
}

These commands are unrelated, but their sequential execution can induce up to ~300ms of delay in the worst case. This overhead becomes more significant when using commands that involve I/O, network access, or external binaries.

Motivation

Allowing command modules to execute in parallel would reduce latency and improve responsiveness, especially in setups where multiple independent commands are used. This is particularly relevant for:

  • Network-bound tools (gh, curl, ping)
  • Disk I/O utilities (du, fd, lsblk)
  • External binaries with startup cost (flatpak, snap, nix)

An opt-in "parallel": true flag for command modules would give users control over execution strategy without breaking existing behavior.

Additional context

Suggested syntax:

{
  "type": "command",
  "key": "│ {#35} editor     {#keys}│",
  "text": "%EDITOR% --version",
  "parallel": true
},
{
  "type": "command",
  "key": "│ {#35} visual     {#keys}│",
  "text": "echo %VISUAL%",
  "parallel": true
}

This feature would be:

  • Backward-compatible (default remains sequential)
  • Useful for benchmarking, async info gathering, and performance-sensitive setups
  • Potentially extendable to other custom modules in the future

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions