Benchmark String interpolation across size pools

This commit is contained in:
Matt Valentine-House 2023-01-10 21:13:18 +00:00 коммит произвёл Peter Zhu
Родитель bb5fddd070
Коммит 2605615fe6
1 изменённых файлов: 6 добавлений и 0 удалений

Просмотреть файл

@ -1,6 +1,8 @@
prelude: | prelude: |
CHUNK = "a" * 64 CHUNK = "a" * 64
UCHUNK = "é" * 32 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 GC.disable # GC causes a lot of variance
benchmark: benchmark:
binary_concat_7bit: | 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}#{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}"