зеркало из https://github.com/github/ruby.git
Benchmark String interpolation across size pools
This commit is contained in:
Родитель
bb5fddd070
Коммит
2605615fe6
|
@ -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}"
|
||||||
|
|
Загрузка…
Ссылка в новой задаче