| Age | Commit message (Collapse) | Author |
|
[Feature #21788]
It allows monitor to access internal routines and remove some overhead.
Before:
```
ruby 4.0.0dev (2025-12-13T04:52:13Z master 71dd272506) +YJIT +PRISM [arm64-darwin25]
Warming up --------------------------------------
Mutex 2.111M i/100ms
Monitor 1.736M i/100ms
Calculating -------------------------------------
Mutex 25.050M (± 0.4%) i/s (39.92 ns/i) - 126.631M in 5.055208s
Monitor 19.809M (± 0.1%) i/s (50.48 ns/i) - 100.672M in 5.082015s
```
After:
```
ruby 4.0.0dev (2025-12-13T06:49:18Z core-monitor 6fabf389fd) +YJIT +PRISM [arm64-darwin25]
Warming up --------------------------------------
Mutex 2.144M i/100ms
Monitor 1.859M i/100ms
Calculating -------------------------------------
Mutex 24.771M (± 0.4%) i/s (40.37 ns/i) - 124.342M in 5.019716s
Monitor 23.722M (± 0.4%) i/s (42.15 ns/i) - 118.998M in 5.016361s
```
Bench:
```ruby
require 'bundler/inline'
gemfile do
gem "benchmark-ips"
end
mutex = Mutex.new
require "monitor"
monitor = Monitor.new
Benchmark.ips do |x|
x.report("Mutex") { mutex.synchronize { } }
x.report("Monitor") { monitor.synchronize { } }
end
```
|
|
|
|
|
|
Notes:
Merged: https://github.com/ruby/ruby/pull/7310
|
|
Notes:
Merged: https://github.com/ruby/ruby/pull/7330
|
|
Split `PACKED_STRUCT` and `PACKED_STRUCT_UNALIGNED` macros into the
macros bellow:
* `RBIMPL_ATTR_PACKED_STRUCT_BEGIN`
* `RBIMPL_ATTR_PACKED_STRUCT_END`
* `RBIMPL_ATTR_PACKED_STRUCT_UNALIGNED_BEGIN`
* `RBIMPL_ATTR_PACKED_STRUCT_UNALIGNED_END`
Notes:
Merged: https://github.com/ruby/ruby/pull/7268
|
|
Notes:
Merged: https://github.com/ruby/ruby/pull/5474
|
|
|
|
Notes:
Merged: https://github.com/ruby/ruby/pull/4371
|
|
Notes:
Merged: https://github.com/ruby/ruby/pull/3347
|
|
Notes:
Merged: https://github.com/ruby/ruby/pull/3346
|
|
Notes:
Merged: https://github.com/ruby/ruby/pull/3338
|
|
To fix build failures.
Notes:
Merged: https://github.com/ruby/ruby/pull/3079
|
|
This shall fix compile errors.
Notes:
Merged: https://github.com/ruby/ruby/pull/3079
|
|
Split ruby.h
Notes:
Merged-By: shyouhei <shyouhei@ruby-lang.org>
|
|
Recent monitor.rb has performance problem because of interrupt
handlers. 'Monitor#synchronize' is frequently used primitive
so the performance of this method is important.
This patch rewrite 'monitor.rb' with 'monitor.so' (C-extension)
and make it faster. See [Feature #16255] for details.
Monitor class objects are normal object which include MonitorMixin.
This patch introduce a Monitor class which is implemented on C
and MonitorMixin uses Monitor object as re-entrant (recursive)
Mutex. This technique improve performance because we don't need
to care atomicity and we don't need accesses to instance variables
any more on Monitor class.
Notes:
Merged-By: ko1 <ko1@atdot.net>
|