-
Notifications
You must be signed in to change notification settings - Fork 0
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
1 parent
51a7fe7
commit f3ab6a3
Showing
4 changed files
with
60 additions
and
5 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 |
---|---|---|
@@ -0,0 +1,33 @@ | ||
# go-uuid Benchmarks | ||
|
||
This directory contains benchmarks for the go-uuid package, comparing it to `google/uuid` and `gofrs/uuid`. | ||
This package does not claim to be the fastest, or the best, so these benchmarks are provided to give you an idea of how | ||
it compares to other packages. | ||
|
||
## Running Benchmarks | ||
|
||
To run the benchmarks, execute the following command: | ||
|
||
```bash | ||
go test -benchmem -bench=. | ||
``` | ||
|
||
## Results | ||
|
||
The results of the benchmarks are as follows: | ||
|
||
```bash | ||
$ go test -bench=. -benchmem | ||
goos: darwin | ||
goarch: arm64 | ||
pkg: github.com/cmackenzie1/go-uuid/bench | ||
cpu: Apple M2 | ||
BenchmarkNewV4-8 4511821 257.2 ns/op 16 B/op 1 allocs/op | ||
BenchmarkGoogleV4-8 4826209 252.2 ns/op 16 B/op 1 allocs/op | ||
BenchmarkGofrsV4-8 4460016 254.6 ns/op 16 B/op 1 allocs/op | ||
BenchmarkNewV7-8 10082949 122.8 ns/op 16 B/op 1 allocs/op | ||
BenchmarkGoogleV7-8 3549622 298.6 ns/op 16 B/op 1 allocs/op | ||
BenchmarkGofrsV7-8 9184320 136.5 ns/op 16 B/op 1 allocs/op | ||
PASS | ||
ok github.com/cmackenzie1/go-uuid/bench 8.644s | ||
``` |
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
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 |
---|---|---|
@@ -1,2 +1,4 @@ | ||
github.com/gofrs/uuid/v5 v5.3.0 h1:m0mUMr+oVYUdxpMLgSYCZiXe7PuVPnI94+OMeVBNedk= | ||
github.com/gofrs/uuid/v5 v5.3.0/go.mod h1:CDOjlDMVAtN56jqyRUZh58JT31Tiw7/oQyEXZV+9bD8= | ||
github.com/google/uuid v1.6.0 h1:NIvaJDMOsjHA8n1jAhLSgzrAzy1Hgr+hNrb57e+94F0= | ||
github.com/google/uuid v1.6.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= |