From 2605615fe6c540740ce921c181c1bc081c019e49 Mon Sep 17 00:00:00 2001 From: Matt Valentine-House Date: Tue, 10 Jan 2023 21:13:18 +0000 Subject: [PATCH] Benchmark String interpolation across size pools --- benchmark/string_concat.yml | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/benchmark/string_concat.yml b/benchmark/string_concat.yml index e65c00cca9..da14692f5e 100644 --- a/benchmark/string_concat.yml +++ b/benchmark/string_concat.yml @@ -1,6 +1,8 @@ prelude: | CHUNK = "a" * 64 UCHUNK = "é" * 32 + SHORT = "a" * (GC::INTERNAL_CONSTANTS[:BASE_SLOT_SIZE] / 2) + LONG = "a" * (GC::INTERNAL_CONSTANTS[:BASE_SLOT_SIZE] * 2) GC.disable # GC causes a lot of variance benchmark: binary_concat_7bit: | @@ -43,3 +45,7 @@ benchmark: "#{CHUNK}#{CHUNK}#{CHUNK}#{CHUNK}#{CHUNK}#{CHUNK}#{CHUNK}#{CHUNK}#{CHUNK}#{CHUNK}" \ "#{CHUNK}#{CHUNK}#{CHUNK}#{CHUNK}#{CHUNK}#{CHUNK}#{CHUNK}#{CHUNK}#{CHUNK}#{CHUNK}" \ "#{CHUNK}#{CHUNK}#{CHUNK}#{CHUNK}#{CHUNK}#{CHUNK}#{CHUNK}#{CHUNK}#{CHUNK}" + interpolation_same_size_pool: | + buffer = "#{SHORT}#{SHORT}" + interpolation_switching_size_pools: | + buffer = "#{SHORT}#{LONG}"