Cache calls to Process.pid
04-Mar-2023 978
Cache calls to Process.pid to avoid lots of useless system calls on modern Linux.Ruby's Process.pid calls the standard libc getpid(2), historically pretty much all implementations of the libc have been caching this function to avoid doing a syscall everytime.However glibc 2.25 released in 2017 removed that cache, causing a performance regression for application frequently monitoring the PID.
Cache calls to Process.pid #ruby #rubydeveloper #rubyonrails #Cache #calls #Process.pid https://rubyonrails.ba/link/cache-calls-to-process-pid