Skip to content

host: cache static system info on AIX to avoid repeated subprocess spawns#2061

Open
Dylan-M wants to merge 5 commits intoshirou:masterfrom
Dylan-M:dylanmyers/host-1f-cache-static
Open

host: cache static system info on AIX to avoid repeated subprocess spawns#2061
Dylan-M wants to merge 5 commits intoshirou:masterfrom
Dylan-M:dylanmyers/host-1f-cache-static

Conversation

@Dylan-M
Copy link
Copy Markdown
Contributor

@Dylan-M Dylan-M commented Mar 21, 2026

⚠️ Review order: This PR depends on #2040 being merged first. See #2072 for the full review order.

Summary

AIX host info functions (HostID, PlatformInformation, KernelVersion, KernelArch) spawn subprocesses (uname, oslevel, bootinfo) to query system identifiers that never change at runtime. Each call was re-executing these commands unnecessarily.

This caches the results using sync.Once so each command is only executed on first access. Dynamic data (boot time, uptime, users, virtualization) is not cached.

Note: This PR depends on #2040 being merged first (uses getInvoker pattern from that PR).

Only affects AIX — no cross-platform changes.

@Dylan-M Dylan-M force-pushed the dylanmyers/host-1f-cache-static branch from b293a65 to b05ebaa Compare March 21, 2026 18:30
@Dylan-M Dylan-M force-pushed the dylanmyers/host-1f-cache-static branch 4 times, most recently from 955d6b9 to c322a71 Compare March 27, 2026 16:27
@Dylan-M Dylan-M force-pushed the dylanmyers/host-1f-cache-static branch from c322a71 to 99b796e Compare March 30, 2026 16:44
@Dylan-M Dylan-M force-pushed the dylanmyers/host-1f-cache-static branch from 99b796e to 43907b0 Compare April 9, 2026 22:53
@Dylan-M Dylan-M force-pushed the dylanmyers/host-1f-cache-static branch from 43907b0 to 26d54d6 Compare April 27, 2026 12:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant