1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00
ruby--ruby/benchmark/string_swapcase.yml
2020-02-29 15:42:24 +09:00

18 lines
599 B
YAML

prelude: |
str1 = [*"A".."M",*"n".."z",*"0".."9"].join("")
str10 = str1 * 10
str100 = str10 * 10
str1000 = str100 * 10
nonascii1 = [*"\u{c0}".."\u{cf}",*"\u{f0}".."\u{ff}"].join("")
nonascii10 = nonascii1 * 10
nonascii100 = nonascii10 * 10
nonascii1000 = nonascii100 * 10
benchmark:
swapcase-1: str1.swapcase
swapcase-10: str10.swapcase
swapcase-100: str100.swapcase
swapcase-1000: str1000.swapcase
swapcase-nonascii1: nonascii1.swapcase
swapcase-nonascii10: nonascii10.swapcase
swapcase-nonascii100: nonascii100.swapcase
swapcase-nonascii1000: nonascii1000.swapcase