Skip to content

cpu: reduce syscalls and avoid runtime fmt parsing#2087

Open
IAKOBVS wants to merge 3 commits into
flightlessmango:masterfrom
IAKOBVS:master
Open

cpu: reduce syscalls and avoid runtime fmt parsing#2087
IAKOBVS wants to merge 3 commits into
flightlessmango:masterfrom
IAKOBVS:master

Conversation

@IAKOBVS

@IAKOBVS IAKOBVS commented Jul 7, 2026

Copy link
Copy Markdown

Currently, ReadcpuTempFile() uses lseek() + read() internally and parses the temperature string with fscanf(). Now, pread(), directly reading from offset 0, avoids the double syscall from lseek() + read() and the internal locking in the stdio functions, and strtol() avoids the runtime format parsing and the variadic argument overhead from fscanf().

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.

1 participant