Skip to content

Reduce stat syscalls#919

Merged
amomchilov merged 1 commit into
mainfrom
Alex/reduce-syscalls
May 13, 2026
Merged

Reduce stat syscalls#919
amomchilov merged 1 commit into
mainfrom
Alex/reduce-syscalls

Conversation

@amomchilov
Copy link
Copy Markdown
Contributor

Don't check File.file? before File.read. If anything it's a TOC/TOU error, but it's also an extra stat system call.

Instead, just try to read, and rescue the exception, if any.

Don't check `File.file?` before `File.read`. If anything it's a [TOC/TOU](https://en.wikipedia.org/wiki/Time-of-check_to_time-of-use) error, but it's also an extra stat system call.

Instead, just try to read, and rescue the exception, if any.
@amomchilov amomchilov requested a review from a team as a code owner May 13, 2026 14:36
@amomchilov amomchilov enabled auto-merge May 13, 2026 15:06
@amomchilov amomchilov merged commit 682bc1e into main May 13, 2026
13 checks passed
@amomchilov amomchilov deleted the Alex/reduce-syscalls branch May 13, 2026 17:15
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