Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- [MemoryDiagnoser]
- public class Benchmark {
- private readonly SearchProperties _searchProperties;
- public Benchmark() {
- _properties = new Properties();
- } [Benchmark(Baseline = true)]
- public void WithDapper() {
- var ids = new List < string > {
- "05edc08b-c27f-4e4d-bb5c-0045959d93a4",
- "a0290013-d568-407c-a1f3-340cdff10cb5", "4f6e2712-9412-4d84-90e4-44ccab389a44", "6f9eda0e-03ba-4456-8926-65713d9a35f9", "ec186495-8191-4e20-b090-72c2005f3681", "adc6f649-3058-4cc1-94c1-e9a36d9bda3d", "8406561b-247c-4e2e-a45a-ebe35b2af715"
- };
- foreach(var id in ids) {
- var appId = Guid.Parse(id);
- _properties.WithDapper(appId);
- }
- } [Benchmark]
- public void WithoutDapper() {
- var ids = new List < string > {
- "05edc08b-c27f-4e4d-bb5c-0045959d93a4",
- "a0290013-d568-407c-a1f3-340cdff10cb5", "4f6e2712-9412-4d84-90e4-44ccab389a44", "6f9eda0e-03ba-4456-8926-65713d9a35f9", "ec186495-8191-4e20-b090-72c2005f3681", "adc6f649-3058-4cc1-94c1-e9a36d9bda3d", "8406561b-247c-4e2e-a45a-ebe35b2af715"
- };
- foreach(var id in ids) {
- var appId = Guid.Parse(id);
- _properties.WithoutDapper(appId).GetAwaiter().GetResult();
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement