Skip to content

Comments

Keep instance of sysinfo System struct#23

Merged
SpikeHD merged 4 commits intoSpikeHD:mainfrom
Small-Ku:fix/persist-sysinfo
Dec 16, 2025
Merged

Keep instance of sysinfo System struct#23
SpikeHD merged 4 commits intoSpikeHD:mainfrom
Small-Ku:fix/persist-sysinfo

Conversation

@Small-Ku
Copy link
Contributor

Not really a fix but I see sysinfo recommends keeping this struct.

Another issue frequently encountered: unless you know what you're doing, it's almost all the time better to instantiate the System struct once and use this one instance through your program.

Another example why it's much better: in case you want to list all running processes, sysinfo needs to allocate all memory for the Process struct list, which takes quite some time on the first run.

They also disable multithread feature by default since 0.34 because of GuillaumeGomez/sysinfo#1352. Since we don't use sysinfo in Linux, I re-enabled it in lib\Cargo.toml.

@SpikeHD
Copy link
Owner

SpikeHD commented Dec 16, 2025

Nice! Thank you!

@SpikeHD SpikeHD merged commit ad0f853 into SpikeHD:main Dec 16, 2025
12 checks passed
@Small-Ku Small-Ku deleted the fix/persist-sysinfo branch December 16, 2025 17:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants