Add benchmarks for fstring de-duplication

This commit is contained in:
John Hawthorn 2025-04-16 18:27:38 -07:00
parent 57b6a7503f
commit 3a29e835e6
Notes: git 2025-04-18 04:04:10 +00:00
2 changed files with 34 additions and 0 deletions

View 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

View 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