Skip to content

Commit f5d5e0f

Browse files
authored
Merge pull request #442 from eregon/fix-harness-common-ractor-defined
Fix make_shareable shim in harness-common.rb
2 parents f9ce1d3 + 704f891 commit f5d5e0f

File tree

21 files changed

+38
-37
lines changed

21 files changed

+38
-37
lines changed

.github/workflows/test.yml

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ jobs:
6565
strategy:
6666
fail-fast: false
6767
matrix:
68-
ruby: [ruby, head, truffleruby]
68+
ruby: [ruby, head]
6969
if: ${{ github.event_name != 'schedule' || github.repository == 'ruby/ruby-bench' }}
7070
steps:
7171
- uses: actions/checkout@v3
@@ -80,14 +80,13 @@ jobs:
8080
WARMUP_ITRS: '1'
8181
MIN_BENCH_ITRS: '1'
8282
MIN_BENCH_TIME: '0'
83-
continue-on-error: ${{ matrix.ruby == 'truffleruby' }}
8483

8584
benchmark-ractor-only:
8685
runs-on: ubuntu-latest
8786
strategy:
8887
fail-fast: false
8988
matrix:
90-
ruby: [ruby, head, truffleruby]
89+
ruby: [ruby, head]
9190
if: ${{ github.event_name != 'schedule' || github.repository == 'ruby/ruby-bench' }}
9291
steps:
9392
- uses: actions/checkout@v3
@@ -102,7 +101,6 @@ jobs:
102101
WARMUP_ITRS: '1'
103102
MIN_BENCH_ITRS: '1'
104103
MIN_BENCH_TIME: '0'
105-
continue-on-error: ${{ matrix.ruby == 'truffleruby' }}
106104

107105
benchmark-graph:
108106
runs-on: ubuntu-latest

benchmarks-ractor/json_parse_float/benchmark.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
rand, rand, rand, rand, rand, rand, rand, rand, rand, rand,
1313
].to_json
1414
end
15-
Ractor.make_shareable(list)
15+
make_shareable(list)
1616

1717
# Work is divided between ractors
1818
run_benchmark(5, ractor_args: [list]) do |num_rs, list|

benchmarks-ractor/json_parse_string/benchmark.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@
3030
"string #{i}" => "value #{i}",
3131
}.to_json
3232
end
33-
Ractor.make_shareable(list)
33+
make_shareable(list)
3434

3535
# Work is divided between ractors
3636
run_benchmark(5, ractor_args: [list]) do |num_rs, list|

benchmarks-ractor/knucleotide/benchmark.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ def generate_test_sequence(size)
5252
end
5353

5454
# Make sequence shareable for Ractors
55-
TEST_SEQUENCE = Ractor.make_shareable(generate_test_sequence(100_000))
55+
TEST_SEQUENCE = make_shareable(generate_test_sequence(100_000))
5656

5757
run_benchmark(5) do |num_ractors, ractor_args|
5858
freqs = [1, 2]

benchmarks/attr_accessor.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ def get_value_loop
3535
end
3636

3737
OBJ = TheClass.new
38-
Ractor.make_shareable(OBJ)
38+
make_shareable(OBJ)
3939

4040
run_benchmark(10) do
4141
OBJ.get_value_loop

benchmarks/blurhash/benchmark.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -176,7 +176,7 @@ def blurHashForPixels(xComponents, yComponents, width, height, rgb, bytesPerRow)
176176

177177
FILE = File.join(__dir__, "test.bin")
178178

179-
Ractor.make_shareable(ARRAY = File.read(FILE).bytes)
179+
make_shareable(ARRAY = File.read(FILE).bytes)
180180

181181
run_benchmark(10) do
182182
Blurhash.encode_rb(204, 204, ARRAY)

benchmarks/erubi/benchmark.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ def run_erb
5858

5959
# This is taken from actual "gem server" data
6060
VALUES = JSON.load(File.read "gem_specs.json")
61-
Ractor.make_shareable(VALUES)
61+
make_shareable(VALUES)
6262
check_result_size(ErbRenderer.new(VALUES).run_erb)
6363

6464
run_benchmark(50) do

benchmarks/graphql/benchmark.rb

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,16 +5,16 @@
55

66
require "graphql"
77

8-
DATA = Ractor.make_shareable(File.read "negotiate.gql")
8+
DATA = make_shareable(File.read "negotiate.gql")
99

1010
if ENV["RUBY_BENCH_RACTOR_HARNESS"]
1111
GraphQL.default_parser
12-
Ractor.make_shareable(GraphQL::Tracing::NullTrace)
12+
make_shareable(GraphQL::Tracing::NullTrace)
1313
GraphQL::Language::Lexer.constants.each do |constant|
14-
Ractor.make_shareable(GraphQL::Language::Lexer.const_get(constant))
14+
make_shareable(GraphQL::Language::Lexer.const_get(constant))
1515
end
1616
GraphQL::Language::Parser.constants.each do |constant|
17-
Ractor.make_shareable(GraphQL::Language::Parser.const_get(constant))
17+
make_shareable(GraphQL::Language::Parser.const_get(constant))
1818
end
1919
end
2020

benchmarks/hexapdf/benchmark.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,8 @@
1919
Dir["/tmp/hexapdf-result*.pdf"].each { |file| FileUtils.rm file }
2020

2121
if ENV["RUBY_BENCH_RACTOR_HARNESS"]
22-
Ractor.make_shareable(HexaPDF::DefaultDocumentConfiguration)
23-
Ractor.make_shareable(HexaPDF::GlobalConfiguration)
22+
make_shareable(HexaPDF::DefaultDocumentConfiguration)
23+
make_shareable(HexaPDF::GlobalConfiguration)
2424
# TODO... still doesn't work
2525
end
2626

benchmarks/lee/benchmark.rb

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -87,10 +87,10 @@ def lay(depth, solution)
8787
Dir.chdir __dir__
8888
use_gemfile
8989

90-
BOARD = Ractor.make_shareable(board)
91-
OBSTRUCTED = Ractor.make_shareable(obstructed)
92-
OUTPUT_FILENAME = Ractor.make_shareable(output_filename)
93-
EXPANSIONS_DIR = Ractor.make_shareable(expansions_dir)
90+
BOARD = make_shareable(board)
91+
OBSTRUCTED = make_shareable(obstructed)
92+
OUTPUT_FILENAME = make_shareable(output_filename)
93+
EXPANSIONS_DIR = make_shareable(expansions_dir)
9494

9595
run_benchmark(10) do
9696
depth = Lee::Matrix.new(BOARD.height, BOARD.width)

0 commit comments

Comments
 (0)