Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
add some new string(char, int) benchmarks
  • Loading branch information
adamsitnik committed Nov 15, 2021
commit 7ccaca7c0a15a094c34a43974f3b503e9cf782c6
6 changes: 6 additions & 0 deletions src/benchmarks/micro/libraries/System.Runtime/Perf.String.cs
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,12 @@ public static IEnumerable<object> TestStringSizes()
yield return new StringArguments(1000);
}

[Benchmark]
[Arguments(1)]
[Arguments(10)]
[Arguments(100)]
public string CtorCharCount(int size) => new string('a', size);

[Benchmark]
[ArgumentsSource(nameof(TestStringSizes))]
public char[] GetChars(StringArguments size) // the argument is called "size" to keep the old benchmark ID, do NOT rename it
Expand Down