ExtensionsBenchmarks.cs 516 B

123456789101112131415161718192021222324252627
  1. using BenchmarkDotNet.Attributes;
  2. using Renci.SshNet.Common;
  3. namespace Renci.SshNet.Benchmarks.Common
  4. {
  5. public class ExtensionsBenchmarks
  6. {
  7. private byte[]? _data;
  8. [Params(1000, 10000)]
  9. public int N { get; set; }
  10. [GlobalSetup]
  11. public void Setup()
  12. {
  13. _data = new byte[N];
  14. new Random(42).NextBytes(_data);
  15. }
  16. [Benchmark]
  17. public byte[] Reverse()
  18. {
  19. return _data.Reverse();
  20. }
  21. }
  22. }