File tree Expand file tree Collapse file tree 4 files changed +15
-130
lines changed
Sources/RegexBenchmark/Inputs
Utils/benchmark-generators Expand file tree Collapse file tree 4 files changed +15
-130
lines changed Original file line number Diff line number Diff line change 1+ //===----------------------------------------------------------------------===//
2+ //
3+ // This source file is part of the Swift.org open source project
4+ //
5+ // Copyright (c) 2025 Apple Inc. and the Swift project authors
6+ // Licensed under Apache License v2.0 with Runtime Library Exception
7+ //
8+ // See https://swift.org/LICENSE.txt for license information
9+ //
10+ //===----------------------------------------------------------------------===//
11+
12+ // Generated using one of the "fasta" programs in
13+ // the Computer Language Benchmarks Game:
14+ // https://benchmarksgame-team.pages.debian.net/benchmarksgame/description/fasta.html#fasta
15+
116extension Inputs {
217 static let dnaFASTA = """
318>ONE Homo sapiens alu
Original file line number Diff line number Diff line change 1- < << << << HEAD
2- # python3 generateEmails.py > output.txt
3-
4- import string
5- import random
6- == == == =
71##===----------------------------------------------------------------------===##
82##
93## This source file is part of the Swift.org open source project
2115import string
2216
2317random .seed (0 )
24- > >> >> >> main
2518
2619domain_charset = string .ascii_letters + string .digits + ".-"
2720locale_charset = domain_charset + "_%+"
3124# for the most part this will generate mostly valid emails
3225# there are some edge cases with double hyphens and double periods that cause
3326# issues but otherwise this should work
34- < << << << HEAD
35-
36- for _ in range (n ):
37- domain_len = random .randint (2 ,64 )
38- locale_len = random .randint (2 ,64 )
39- tld_len = random .randint (2 ,10 )
40-
41- domain = "" .join (random .sample (domain_charset , domain_len ))
42- locale = "" .join (random .sample (locale_charset , locale_len ))
43- tld = "" .join (random .sample (string .ascii_lowercase , tld_len ))
44- email = locale + "@" + domain + "." + tld
45- print (email .lower ())
46- == == == =
4727emails = []
4828for _ in range (n ):
4929 domain_len = random .randint (2 , 64 )
6949email_text = "\n " .join (emails )
7050email_list_formatted = "[" + ",\n " .join (["\" " + x + "\" " for x in emails ]) + "]"
7151print (res .format (email_text , email_list_formatted ))
72- > >> >> >> main
Load Diff This file was deleted.
Original file line number Diff line number Diff line change 1- < << << << HEAD
2- == == == =
31##===----------------------------------------------------------------------===##
42##
53## This source file is part of the Swift.org open source project
119##
1210##===----------------------------------------------------------------------===##
1311
14- >> >> >> > main
1512# Generates lines of junk unicode wrapped in html tags
1613import random
1714
3027minLine = 10
3128maxLine = 100
3229
33- < << << << HEAD
34- def get_random (i ):
35- return "" .join ([chr (random .randint (low , high )) for _ in range (i )])
36-
37- lines = [start + get_random (random .randint (minLine , maxLine )) + end for _ in range (numLines )]
38- == == == =
3930
4031def get_random (i ):
4132 return "" .join ([chr (random .randint (low , high )) for _ in range (i )])
@@ -45,6 +36,5 @@ def get_random(i):
4536 start + get_random (random .randint (minLine , maxLine )) + end
4637 for _ in range (numLines )
4738]
48- > >> >> >> main
4939
5040print ("\n " .join (lines ))
You can’t perform that action at this time.
0 commit comments