Skip to content

Commit 3a29e83

Browse files
committed
Add benchmarks for fstring de-duplication
1 parent 57b6a75 commit 3a29e83

File tree

2 files changed

+34
-0
lines changed

2 files changed

+34
-0
lines changed
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
type: lib/benchmark_driver/runner/ractor
2+
benchmark:
3+
ractor_fstring_random: |
4+
i = 0
5+
str = "same".dup
6+
while i < 2000000
7+
-(i.to_s.freeze)
8+
i += 1
9+
end
10+
ractor_fstring_same: |
11+
i = 0
12+
str = "same".dup
13+
while i < 2000000
14+
-str
15+
i += 1
16+
end
17+
loop_count: 1
18+
ractor: 4

benchmark/string_fstring.yml

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
benchmark:
2+
fstring_random: |
3+
i = 0
4+
str = "same".dup
5+
while i < 5_000_000
6+
-(i.to_s.freeze)
7+
i += 1
8+
end
9+
fstring_same: |
10+
i = 0
11+
str = "same".dup
12+
while i < 10_000_000
13+
-str
14+
i += 1
15+
end
16+
loop_count: 1

0 commit comments

Comments
 (0)