Skip to content

Commit b03fb31

Browse files
authored
add some new string(char, int) benchmarks (#2132)
1 parent 886b585 commit b03fb31

1 file changed

Lines changed: 6 additions & 0 deletions

File tree

src/benchmarks/micro/libraries/System.Runtime/Perf.String.cs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,12 @@ public static IEnumerable<object> TestStringSizes()
2020
yield return new StringArguments(1000);
2121
}
2222

23+
[Benchmark]
24+
[Arguments(1)]
25+
[Arguments(10)]
26+
[Arguments(100)]
27+
public string CtorCharCount(int size) => new string('a', size);
28+
2329
[Benchmark]
2430
[ArgumentsSource(nameof(TestStringSizes))]
2531
public char[] GetChars(StringArguments size) // the argument is called "size" to keep the old benchmark ID, do NOT rename it

0 commit comments

Comments
 (0)