redis-rb / redis-client

Simple low level client for Redis 6+
MIT License
124 stars 60 forks source link

Cache Process.pid on Ruby 3.1+ #91

Closed casperisfine closed 1 year ago

casperisfine commented 1 year ago

Ref: https://bugs.ruby-lang.org/issues/19443

Recent glibc no longer cache the PID, so every call to Process.pid end up emitting a syscall which as an impact on performance.

Ruby 3.3 may or may not do PID caching, in the meantime we can implement our own caching in Ruby 3.1+ using the Process._fork callback.

FYI: @dalehamel