Advertisement
Guest User

Untitled

a guest
Aug 24th, 2019
83
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.10 KB | None | 0 0
  1. [MemoryDiagnoser]
  2. public class Benchmark {
  3. private readonly SearchProperties _searchProperties;
  4. public Benchmark() {
  5. _properties = new Properties();
  6. } [Benchmark(Baseline = true)]
  7. public void WithDapper() {
  8. var ids = new List < string > {
  9. "05edc08b-c27f-4e4d-bb5c-0045959d93a4",
  10. "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"
  11. };
  12. foreach(var id in ids) {
  13. var appId = Guid.Parse(id);
  14. _properties.WithDapper(appId);
  15. }
  16. } [Benchmark]
  17. public void WithoutDapper() {
  18. var ids = new List < string > {
  19. "05edc08b-c27f-4e4d-bb5c-0045959d93a4",
  20. "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"
  21. };
  22. foreach(var id in ids) {
  23. var appId = Guid.Parse(id);
  24. _properties.WithoutDapper(appId).GetAwaiter().GetResult();
  25. }
  26. }
  27. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement