Actions
Bug #19461
closedTime.local performance tanks in forked process (on macOS only?)
Bug #19461:
Time.local performance tanks in forked process (on macOS only?)
Description
The following program demonstrates a performance regression in forked child processes when invoking Time.local
:
require 'benchmark'
require 'time'
def sir_local_alot
result = Benchmark.measure do
10_000.times do
tm = ::Time.local(2023)
end
end
$stderr.puts result
end
sir_local_alot
pid = fork do
sir_local_alot
end
Process.wait(pid)
On Linux the performance is similar, but on macOS, the performance is over 100x worse on my M1 laptop.
Files
Actions