mirror of
https://github.com/ruby/ruby.git
synced 2025-08-15 13:39:04 +02:00
Add benchmarks for fstring de-duplication
This commit is contained in:
parent
57b6a7503f
commit
3a29e835e6
Notes:
git
2025-04-18 04:04:10 +00:00
2 changed files with 34 additions and 0 deletions
18
benchmark/ractor_string_fstring.yml
Normal file
18
benchmark/ractor_string_fstring.yml
Normal file
|
@ -0,0 +1,18 @@
|
||||||
|
type: lib/benchmark_driver/runner/ractor
|
||||||
|
benchmark:
|
||||||
|
ractor_fstring_random: |
|
||||||
|
i = 0
|
||||||
|
str = "same".dup
|
||||||
|
while i < 2000000
|
||||||
|
-(i.to_s.freeze)
|
||||||
|
i += 1
|
||||||
|
end
|
||||||
|
ractor_fstring_same: |
|
||||||
|
i = 0
|
||||||
|
str = "same".dup
|
||||||
|
while i < 2000000
|
||||||
|
-str
|
||||||
|
i += 1
|
||||||
|
end
|
||||||
|
loop_count: 1
|
||||||
|
ractor: 4
|
16
benchmark/string_fstring.yml
Normal file
16
benchmark/string_fstring.yml
Normal file
|
@ -0,0 +1,16 @@
|
||||||
|
benchmark:
|
||||||
|
fstring_random: |
|
||||||
|
i = 0
|
||||||
|
str = "same".dup
|
||||||
|
while i < 5_000_000
|
||||||
|
-(i.to_s.freeze)
|
||||||
|
i += 1
|
||||||
|
end
|
||||||
|
fstring_same: |
|
||||||
|
i = 0
|
||||||
|
str = "same".dup
|
||||||
|
while i < 10_000_000
|
||||||
|
-str
|
||||||
|
i += 1
|
||||||
|
end
|
||||||
|
loop_count: 1
|
Loading…
Add table
Add a link
Reference in a new issue