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_casecmp.yml
2020-02-29 15:42:24 +09:00

26 lines
924 B
YAML

prelude: |
lstr1 = [*"a".."z",*"0".."9"].join("")
lstr10 = lstr1 * 10
lstr100 = lstr10 * 10
lstr1000 = lstr100 * 10
lnonascii1 = [*"\u{e0}".."\u{ff}"].join("")
lnonascii10 = lnonascii1 * 10
lnonascii100 = lnonascii10 * 10
lnonascii1000 = lnonascii100 * 10
ustr1 = [*"A".."Z",*"0".."9"].join("")
ustr10 = ustr1 * 10
ustr100 = ustr10 * 10
ustr1000 = ustr100 * 10
unonascii1 = [*"\u{c0}".."\u{df}"].join("")
unonascii10 = unonascii1 * 10
unonascii100 = unonascii10 * 10
unonascii1000 = unonascii100 * 10
benchmark:
casecmp-1: lstr1.casecmp(ustr1)
casecmp-10: lstr10.casecmp(ustr10)
casecmp-100: lstr100.casecmp(ustr100)
casecmp-1000: lstr1000.casecmp(ustr1000)
casecmp-nonascii1: lnonascii1.casecmp(unonascii1)
casecmp-nonascii10: lnonascii10.casecmp(unonascii10)
casecmp-nonascii100: lnonascii100.casecmp(unonascii100)
casecmp-nonascii1000: lnonascii1000.casecmp(unonascii1000)