2022-07-06 06:31:54 -04:00
|
|
|
prelude: |
|
|
|
|
CHUNK = "a" * 64
|
2022-07-21 11:08:51 -04:00
|
|
|
UCHUNK = "é" * 32
|
2022-07-21 07:16:16 -04:00
|
|
|
GC.disable # GC causes a lot of variance
|
2022-07-06 06:31:54 -04:00
|
|
|
benchmark:
|
2022-07-21 11:08:51 -04:00
|
|
|
binary_concat_7bit: |
|
2022-06-29 04:35:41 -04:00
|
|
|
buffer = String.new(capacity: 4096, encoding: Encoding::BINARY)
|
|
|
|
buffer << CHUNK << CHUNK << CHUNK << CHUNK << CHUNK << CHUNK << CHUNK << CHUNK
|
|
|
|
buffer << CHUNK << CHUNK << CHUNK << CHUNK << CHUNK << CHUNK << CHUNK << CHUNK
|
|
|
|
buffer << CHUNK << CHUNK << CHUNK << CHUNK << CHUNK << CHUNK << CHUNK << CHUNK
|
|
|
|
buffer << CHUNK << CHUNK << CHUNK << CHUNK << CHUNK << CHUNK << CHUNK << CHUNK
|
|
|
|
buffer << CHUNK << CHUNK << CHUNK << CHUNK << CHUNK << CHUNK << CHUNK << CHUNK
|
|
|
|
buffer << CHUNK << CHUNK << CHUNK << CHUNK << CHUNK << CHUNK << CHUNK << CHUNK
|
|
|
|
buffer << CHUNK << CHUNK << CHUNK << CHUNK << CHUNK << CHUNK << CHUNK << CHUNK
|
2022-07-21 07:16:16 -04:00
|
|
|
buffer << CHUNK << CHUNK << CHUNK << CHUNK << CHUNK << CHUNK << CHUNK
|
2022-07-21 11:08:51 -04:00
|
|
|
utf8_concat_7bit: |
|
2022-06-29 04:35:41 -04:00
|
|
|
buffer = String.new(capacity: 4096, encoding: Encoding::UTF_8)
|
2022-07-06 06:31:54 -04:00
|
|
|
buffer << CHUNK << CHUNK << CHUNK << CHUNK << CHUNK << CHUNK << CHUNK << CHUNK
|
|
|
|
buffer << CHUNK << CHUNK << CHUNK << CHUNK << CHUNK << CHUNK << CHUNK << CHUNK
|
|
|
|
buffer << CHUNK << CHUNK << CHUNK << CHUNK << CHUNK << CHUNK << CHUNK << CHUNK
|
|
|
|
buffer << CHUNK << CHUNK << CHUNK << CHUNK << CHUNK << CHUNK << CHUNK << CHUNK
|
|
|
|
buffer << CHUNK << CHUNK << CHUNK << CHUNK << CHUNK << CHUNK << CHUNK << CHUNK
|
|
|
|
buffer << CHUNK << CHUNK << CHUNK << CHUNK << CHUNK << CHUNK << CHUNK << CHUNK
|
|
|
|
buffer << CHUNK << CHUNK << CHUNK << CHUNK << CHUNK << CHUNK << CHUNK << CHUNK
|
2022-07-21 07:16:16 -04:00
|
|
|
buffer << CHUNK << CHUNK << CHUNK << CHUNK << CHUNK << CHUNK << CHUNK
|
2022-07-21 11:08:51 -04:00
|
|
|
utf8_concat_UTF8: |
|
|
|
|
buffer = String.new(capacity: 4096, encoding: Encoding::UTF_8)
|
|
|
|
buffer << UCHUNK << UCHUNK << UCHUNK << UCHUNK << UCHUNK << UCHUNK << UCHUNK << UCHUNK
|
|
|
|
buffer << UCHUNK << UCHUNK << UCHUNK << UCHUNK << UCHUNK << UCHUNK << UCHUNK << UCHUNK
|
|
|
|
buffer << UCHUNK << UCHUNK << UCHUNK << UCHUNK << UCHUNK << UCHUNK << UCHUNK << UCHUNK
|
|
|
|
buffer << UCHUNK << UCHUNK << UCHUNK << UCHUNK << UCHUNK << UCHUNK << UCHUNK << UCHUNK
|
|
|
|
buffer << UCHUNK << UCHUNK << UCHUNK << UCHUNK << UCHUNK << UCHUNK << UCHUNK << UCHUNK
|
|
|
|
buffer << UCHUNK << UCHUNK << UCHUNK << UCHUNK << UCHUNK << UCHUNK << UCHUNK << UCHUNK
|
|
|
|
buffer << UCHUNK << UCHUNK << UCHUNK << UCHUNK << UCHUNK << UCHUNK << UCHUNK << UCHUNK
|
|
|
|
buffer << UCHUNK << UCHUNK << UCHUNK << UCHUNK << UCHUNK << UCHUNK << UCHUNK
|