-
-
Notifications
You must be signed in to change notification settings - Fork 96
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
6 changed files
with
962 additions
and
40 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -15,3 +15,4 @@ packages/* | |
*.sln.ide | ||
project.lock.json | ||
paket-files/ | ||
BenchmarkDotNet.Artifacts/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
module Expecto.BenchmarkDotNetTests | ||
|
||
open System | ||
open System.Security.Cryptography | ||
open Expecto | ||
open BenchmarkDotNet | ||
|
||
type Md5VsSha256() = | ||
[<Literal>] | ||
let N = 10000 | ||
let data : byte[] = Array.zeroCreate N | ||
let sha256 = SHA256.Create() | ||
let md5 = MD5.Create() | ||
do Random(42).NextBytes data | ||
|
||
[<Benchmark>] | ||
member x.Sha256() = sha256.ComputeHash data | ||
[<Benchmark>] | ||
member x.Md5() = md5.ComputeHash(data) | ||
|
||
[<Tests>] | ||
let benchmarks = | ||
testList "some different benchmarks" [ | ||
benchmark<Md5VsSha256> "md5 versus sha256" benchmarkConfig ignore | ||
] |
Oops, something went wrong.