Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
25 commits
Select commit Hold shift + click to select a range
cd71ed6
Add harness-ractor/harness.rb. Specify `--harness=ractor`
luke-gruber Aug 8, 2025
ef32b65
Make default harness the default.
luke-gruber Aug 8, 2025
966e6f6
Fix issues with require "bundler/setup"
luke-gruber Aug 8, 2025
b651a41
Enable graphql benchmarks with ractor harness
luke-gruber Aug 8, 2025
a64a783
Improve ractor harness and update other harnesses to be compatible
luke-gruber Aug 11, 2025
c1fe70a
Update some benchmarks to be ractor compatible
luke-gruber Oct 10, 2025
d0dc43d
make more benchmarks ractor friendly
luke-gruber Oct 10, 2025
c139cda
Change 30k_methods to work with ractors
luke-gruber Oct 10, 2025
92df6fc
Make attr_accessor benchmark compatible with ractors
luke-gruber Oct 10, 2025
9bbd1d8
Make erubi benchmark compatible with ractors
etiennebarrie Aug 13, 2025
b241b12
Make lee benchmark ractor compatible
luke-gruber Oct 10, 2025
682056c
Fix ruby-xor correctness check
etiennebarrie Aug 18, 2025
f40c24d
Modify run_benchmarks.rb to add 'ractor-only' category
luke-gruber Aug 19, 2025
b88b063
Add max # of iters for harness-ractor
luke-gruber Aug 19, 2025
aacffb8
add benchmarks/*/data dir to .gitignore
luke-gruber Aug 19, 2025
a6fb41c
Tweak setivar to work both with or without ractors
etiennebarrie Aug 20, 2025
e75d739
Add benchmarks/ractor directory with 2 JSON benchmarks
luke-gruber Aug 28, 2025
a3d8e97
Get harness-chain working
luke-gruber Aug 28, 2025
d7ac537
Get optcarrot working with ractors
luke-gruber Aug 28, 2025
68e1f7d
Add ractor benchmark gvl_release_acquire.rb
luke-gruber Aug 29, 2025
82a1ea5
Port over k-nucleotide from TCLBG
eightbitraptor Oct 9, 2025
fe13558
Get ractor-only benchmarks running with recent changes.
luke-gruber Oct 10, 2025
e0881a6
benchmarks.yml doesn't contain custom ractor benchmarks
eightbitraptor Oct 10, 2025
d922a81
Run the ractor only tests in CI too
eightbitraptor Oct 10, 2025
16adae1
Don't scan the ractor directory without --ractor-only
eightbitraptor Oct 10, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,14 @@ jobs:
MIN_BENCH_TIME: '0'
continue-on-error: ${{ matrix.continue-on-error || false }}

- name: Test run_benchmarks.rb --ractor-only
run: ./run_benchmarks.rb --ractor-only
env:
WARMUP_ITRS: '1'
MIN_BENCH_ITRS: '1'
MIN_BENCH_TIME: '0'
continue-on-error: ${{ matrix.continue-on-error || false }}

- name: Test run_benchmarks.rb --graph
run: |
sudo apt-get update
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
*.csv
*.dump
logs*
benchmarks/*/data/

__pycache__
/benchmarks/discourse
Expand Down
27 changes: 27 additions & 0 deletions benchmarks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ mail:
psych-load:
desc: psych-load repeatedly loads a small selection of YAML files taken from various OSS projects.
category: headline
ractor: true
railsbench:
desc: railsbench is a read-only tiny SQLite-backed Rails app, querying a small selection of .html.erb routes and JSON routes.
category: headline
Expand All @@ -54,44 +55,59 @@ binarytrees:
desc: binarytrees from the Computer Language Benchmarks Game.
blurhash:
desc: blurhash (blurred preview image) calculation
ractor: true
erubi:
desc: erubi compiles a simple Erb template into a method with erubi, then times evaluating that method.
ractor: true
etanni:
desc: etanni is an older, extremely simple template-lang format that basically turns your template into an "eval" with a lot of heredocs.
fannkuchredux:
desc: fannkuchredux from the Computer Language Benchmarks Game.
ractor: true
fluentd:
desc: fluentd is a log collector, which parses logs in a server and forwards them to various destinations.
graphql:
desc: GraphQL gem parsing a large file, uses Racc which has some Ruby->native->Ruby calls
ractor: true
graphql-native:
desc: GraphQL gem parsing a large file, but using a native parser
knucleotide:
desc: k-nucleotide from the Computer Language Benchmarks Game - counts nucleotide frequencies using hash tables
ractor: true
lee:
desc: lee is a circuit-board layout solver, deployed in a plausibly reality-like way
matmul:
desc: matrix multiplication benchmark
ractor: true
nbody:
desc: nbody from the Computer Language Benchmarks Game.
nqueens:
desc: solver for the N-Queens problem
ractor: true
optcarrot:
desc: optcarrot is a functional headless NES emulator, run on a specific game cartridge for a specific number of frames.
protoboeuf:
desc: protoboeuf (pure-Ruby protobuf) message decoding
ractor: true
protoboeuf-encode:
desc: protoboeuf (pure-Ruby protobuf) message encoding
ractor: true
rack:
desc: test the performance of the Rack framework with barely any routing.
ruby-json:
desc: an optimized version of the json_pure gem's pure Ruby JSON parser.
ractor: true
rubyboy:
desc: Rubyboy is a functional headless GameBoy emulator, run on a specific game cartridge for a specific number of frames.
ractor: true
rubykon:
desc: Ruby solver for Go (the boardgame.) Runs many iterations forward from an initial starting board.
sudoku:
desc: sudoku solver
ractor: true
tinygql:
desc: TinyGQL gem parsing a large file in pure Ruby
ractor: true

#
# MicroBenchmarks
Expand All @@ -100,6 +116,7 @@ tinygql:
desc: 30k_ifelse tests thousands of nested methods containing simple if/else statements.
category: micro
single_file: true
ractor: true
30k_methods:
desc: 30k_methods tests thousands of nested method calls that mostly just call out to other single-call methods.
category: micro
Expand All @@ -108,18 +125,22 @@ attr_accessor:
desc: attr_accessor tests the performance of getting instance variable values via an attr_accessor imemo.
category: micro
single_file: true
ractor: true
cfunc_itself:
desc: cfunc_itself just calls the 'itself' method many, many times.
category: micro
single_file: true
ractor: true
fib:
desc: Fib is a simple exponential-time recursive Fibonacci number generator.
category: micro
single_file: true
ractor: true
getivar:
desc: getivar tests the performance of getting instance variable values.
category: micro
single_file: true
ractor: true
keyword_args:
desc: keyword_args tests the performance of method calls with keyword arguments.
category: micro
Expand All @@ -128,10 +149,12 @@ loops-times:
desc: nested loop Integer#times and array access microbenchmark
category: micro
single_file: true
ractor: true
object-new:
desc: instantiate a new object in a loop to test allocation performance
category: micro
single_file: true
ractor: true
respond_to:
desc: respond_to tests the performance of the respond_to? method.
category: micro
Expand All @@ -140,6 +163,7 @@ ruby-xor:
desc: pure-Ruby string XOR microbenchmark, analogous to xorcist C extension.
category: micro
single_file: true
ractor: true
setivar:
desc: setivar tests the performance of setting instance variable values.
category: micro
Expand All @@ -152,11 +176,14 @@ setivar_young:
desc: setivar_object tests the performance of setting instance variables to an object, to test write barrier speed on young objects.
category: micro
single_file: true
ractor: true
str_concat:
desc: str_concat tests the performance of string concatenation in multiple different encodings.
category: micro
single_file: true
ractor: true
throw:
desc: microbenchmark for the throw instruction and stack unwinding.
category: micro
single_file: true
ractor: true
37 changes: 26 additions & 11 deletions benchmarks/30k_ifelse.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,11 @@
require_relative '../harness/loader'
if ENV["YJIT_BENCH_RACTOR_HARNESS"]
eval_recv = Object.new
eval_meth = :instance_eval
else
eval_recv = nil
end

def fun_l0_n0(x)
if (x < 1)
fun_l1_n310(x)
Expand Down Expand Up @@ -239998,23 +240006,29 @@ def fun_l29_n999(x)
end
end

@a = 0
@b = 0
@c = 0
@d = 0

@count = 0
def inc(x)
@count += 1
end

@x = 0

require_relative '../harness/loader'

INTERNAL_ITRS = Integer(ENV.fetch("INTERNAL_ITRS", 200))

run_benchmark(30) do
main_obj = ENV["YJIT_BENCH_RACTOR_HARNESS"] ? eval_recv : nil
run_benchmark(30, ractor_args: [main_obj]) do |num_rs, selv|
if selv
recv = selv
recv_meth = :instance_eval
else
recv = 1
recv_meth = :times
end
recv.send(recv_meth) do
@a = 0
@b = 0
@c = 0
@d = 0

@count = 0
@x = 0
INTERNAL_ITRS.times do
@x = (@x < 1)? 1:0
fun_l0_n0(@x)
Expand Down Expand Up @@ -241017,5 +241031,6 @@ def inc(x)
fun_l0_n997(@x)
fun_l0_n998(@x)
fun_l0_n999(@x)
end
end
end
Loading
Loading