Home | History | Annotate | Download | only in stringbench

Lines Matching full:1000

52 _RANGE_1000 = list(range(1000))
75 @bench('"A" in "A"*1000', "early match, single character", 1000)
77 s1 = STR("A" * 1000)
82 @bench('"B" in "A"*1000', "no match, single character", 1000)
84 s1 = STR("A" * 1000)
90 @bench('"AB" in "AB"*1000', "early match, two characters", 1000)
92 s1 = STR("AB" * 1000)
97 @bench('"BC" in "AB"*1000', "no match, two characters", 1000)
99 s1 = STR("AB" * 1000)
104 @bench('"BC" in ("AB"*300+"C")', "late match, two characters", 1000)
140 @bench('("A"*1000).find("A")', "early match, single character", 1000)
142 s1 = STR("A" * 1000)
148 @bench('("A"*1000).find("B")', "no match, single character", 1000)
150 s1 = STR("A" * 1000)
157 @bench('("AB"*1000).find("AB")', "early match, two characters", 1000)
159 s1 = STR("AB" * 1000)
165 @bench('("AB"*1000).find("BC")', "no match, two characters", 1000)
167 s1 = STR("AB" * 1000)
173 @bench('("AB"*1000).find("CA")', "no match, two characters", 1000)
175 s1 = STR("AB" * 1000)
181 @bench('("AB"*300+"C").find("BC")', "late match, two characters", 1000)
189 @bench('("AB"*300+"CA").find("CA")', "late match, two characters", 1000)
224 @bench('("A"*1000).rfind("A")', "early match, single character", 1000)
226 s1 = STR("A" * 1000)
232 @bench('("A"*1000).rfind("B")', "no match, single character", 1000)
234 s1 = STR("A" * 1000)
241 @bench('("AB"*1000).rfind("AB")', "early match, two characters", 1000)
243 s1 = STR("AB" * 1000)
249 @bench('("AB"*1000).rfind("BC")', "no match, two characters", 1000)
251 s1 = STR("AB" * 1000)
257 @bench('("AB"*1000).rfind("CA")', "no match, two characters", 1000)
259 s1 = STR("AB" * 1000)
265 @bench('("C"+"AB"*300).rfind("CA")', "late match, two characters", 1000)
273 @bench('("BC"+"AB"*300).rfind("BC")', "late match, two characters", 1000)
309 @bench('("A"*1000).index("A")', "early match, single character", 1000)
311 s1 = STR("A" * 1000)
317 @bench('("AB"*1000).index("AB")', "early match, two characters", 1000)
319 s1 = STR("AB" * 1000)
325 @bench('("AB"*300+"C").index("BC")', "late match, two characters", 1000)
348 @bench('("A"*1000).rindex("A")', "early match, single character", 1000)
350 s1 = STR("A" * 1000)
356 @bench('("AB"*1000).rindex("AB")', "early match, two characters", 1000)
358 s1 = STR("AB" * 1000)
364 @bench('("C"+"AB"*300).rindex("CA")', "late match, two characters", 1000)
387 @bench('("A"*1000).partition("A")', "early match, single character", 1000)
389 s1 = STR("A" * 1000)
395 @bench('("A"*1000).partition("B")', "no match, single character", 1000)
397 s1 = STR("A" * 1000)
404 @bench('("AB"*1000).partition("AB")', "early match, two characters", 1000)
406 s1 = STR("AB" * 1000)
412 @bench('("AB"*1000).partition("BC")', "no match, two characters", 1000)
414 s1 = STR("AB" * 1000)
420 @bench('("AB"*300+"C").partition("BC")', "late match, two characters", 1000)
443 @bench('("A"*1000).rpartition("A")', "early match, single character", 1000)
445 s1 = STR("A" * 1000)
451 @bench('("A"*1000).rpartition("B")', "no match, single character", 1000)
453 s1 = STR("A" * 1000)
460 @bench('("AB"*1000).rpartition("AB")', "early match, two characters", 1000)
462 s1 = STR("AB" * 1000)
468 @bench('("AB"*1000).rpartition("BC")', "no match, two characters", 1000)
470 s1 = STR("AB" * 1000)
476 @bench('("C"+"AB"*300).rpartition("CA")', "late match, two characters", 1000)
499 @bench('("A"*1000).split("A", 1)', "early match, single character", 1000)
501 s1 = STR("A" * 1000)
507 @bench('("A"*1000).split("B", 1)', "no match, single character", 1000)
509 s1 = STR("A" * 1000)
516 @bench('("AB"*1000).split("AB", 1)', "early match, two characters", 1000)
518 s1 = STR("AB" * 1000)
524 @bench('("AB"*1000).split("BC", 1)', "no match, two characters", 1000)
526 s1 = STR("AB" * 1000)
532 @bench('("AB"*300+"C").split("BC", 1)', "late match, two characters", 1000)
555 @bench('("A"*1000).rsplit("A", 1)', "early match, single character", 1000)
557 s1 = STR("A" * 1000)
563 @bench('("A"*1000).rsplit("B", 1)', "no match, single character", 1000)
565 s1 = STR("A" * 1000)
572 @bench('("AB"*1000).rsplit("AB", 1)', "early match, two characters", 1000)
574 s1 = STR("AB" * 1000)
580 @bench('("AB"*1000).rsplit("BC", 1)', "no match, two characters", 1000)
582 s1 = STR("AB" * 1000)
588 @bench('("C"+"AB"*300).rsplit("CA", 1)', "late match, two characters", 1000)
611 @bench('"A"*10', "repeat 1 character 10 times", 1000)
617 @bench('"A"*1000', "repeat 1 character 1000 times", 1000)
621 s * 1000
623 @bench('"ABCDE"*10', "repeat 5 characters 10 times", 1000)
629 @bench('"ABCDE"*1000', "repeat 5 characters 1000 times", 1000)
633 s * 1000
637 @bench('"Andrew"+"Dalke"', "concat two strings", 1000)
645 1000)
698 "join string with 26 characters, with 1 character sep", 1000)
707 "join string with 26 characters, with 5 character sep", 1000)
716 "join list of 26 characters, with 1 character sep", 1000)
725 "join list of 26 characters, with 5 character sep", 1000)
734 "join list of 100 words, with 1 character sep", 1000)
743 "join list of 100 words, with 5 character sep", 1000)
753 @bench('("Here are some words. "*2).split()', "split whitespace (small)", 1000)
760 @bench('("Here are some words. "*2).rsplit()', "split whitespace (small)", 1000)
768 "split 1 whitespace", 1000)
777 "split 1 whitespace", 1000)
786 "split 1 whitespace", 1000)
795 "split 1 whitespace", 1000)
843 @bench('"this\\nis\\na\\ntest\\n".split("\\n")', "split newlines", 1000)
852 @bench('"this\\nis\\na\\ntest\\n".rsplit("\\n")', "split newlines", 1000)
860 @bench('"this\\nis\\na\\ntest\\n".splitlines()', "split newlines", 1000)
924 "split on multicharacter separator (small)", 1000)
933 "split on multicharacter separator (small)", 1000)
968 @bench('GFF3_example.split("\\t")', "tab split", 1000)
976 @bench('GFF3_example.split("\\t", 8)', "tab split", 1000)
984 @bench('GFF3_example.rsplit("\\t")', "tab split", 1000)
992 @bench('GFF3_example.rsplit("\\t", 8)', "tab split", 1000)
1086 @bench('"Andrew".startswith("A")', 'startswith single character', 1000)
1095 1000)
1104 'startswith multiple characters - not!', 1000)
1115 @bench('"Andrew".endswith("w")', 'endswith single character', 1000)
1123 @bench('"Andrew".endswith("Andrew")', 'endswith multiple characters', 1000)
1132 'endswith multiple characters - not!', 1000)
1142 @bench('"Hello!\\n".strip()', 'strip terminal newline', 1000)
1149 @bench('"Hello!\\n".rstrip()', 'strip terminal newline', 1000)
1156 @bench('"\\nHello!".strip()', 'strip terminal newline', 1000)
1163 @bench('"\\nHello!\\n".strip()', 'strip terminal newline', 1000)
1170 @bench('"\\nHello!".rstrip()', 'strip terminal newline', 1000)
1178 'strip terminal newline', 1000)
1188 @bench('"Hello\\t \\t".strip()', 'strip terminal spaces and tabs', 1000)
1195 @bench('"Hello\\t \\t".rstrip()', 'strip terminal spaces and tabs', 1000)
1202 @bench('"\\t \\tHello".rstrip()', 'strip terminal spaces and tabs', 1000)
1212 1000)
1223 1000)
1278 'replace/remove multiple characters', 1000)
1349 'formatting a string type with a dict', 1000)
1360 "case conversion -- rare", 1000)
1368 "case conversion -- dense", 1000)
1377 "case conversion -- rare", 1000)
1385 "case conversion -- dense", 1000)
1448 bytes_time_s = "%.2f" % (1000 * bytes_time)
1458 uni_time_s = "%.2f" % (1000 * uni_time)
1478 1000*bytes_total, 1000*uni_total, 100.*ratio,