-
Notifications
You must be signed in to change notification settings - Fork 120
Comparing changes
Open a pull request
base repository: gofrs/uuid
base: v4.3.1
head repository: gofrs/uuid
compare: v4.4.0
- 6 commits
- 11 files changed
- 4 contributors
Commits on Jan 6, 2023
-
improve performance and reduce allocations of most UUID methods (#96)
This commit improves the performance and reduces the number of allocs of most UUID methods and adds a new UUID.Parse() method for parsing string encoded UUIDs. Parsing string encoded UUIDs is now 2x faster and no longer allocates. The NullUUID MarshalJSON() and UnmarshalJSON() methods have also been improved and no longer call out to json.Unmarshal. The UUID.Format method has been improved for common cases. Benchmark results: ``` goos: linux goarch: amd64 pkg: github.com/gofrs/uuid cpu: Intel(R) Core(TM) i9-9900K CPU @ 3.60GHz name old time/op new time/op delta UnmarshalText/canonical-16 47.7ns ± 0% 23.1ns ± 1% -51.56% (p=0.000 n=8+10) UnmarshalText/urn-16 47.8ns ± 1% 23.0ns ± 1% -51.85% (p=0.000 n=10+10) UnmarshalText/braced-16 47.8ns ± 1% 23.1ns ± 1% -51.66% (p=0.000 n=9+10) ParseV4-16 86.5ns ±10% 23.0ns ± 5% -73.44% (p=0.000 n=9+10) NullMarshalJSON/Valid-16 308ns ±21% 64ns ±23% -79.18% (p=0.000 n=10+10) NullMarshalJSON/Invalid-16 41.8ns ± 2% 1.5ns ± 4% -96.51% (p=0.000 n=10+10) Format/s-16 151ns ± 3% 132ns ± 3% -12.65% (p=0.000 n=10+10) Format/S-16 305ns ± 2% 157ns ± 4% -48.70% (p=0.000 n=10+10) Format/q-16 217ns ±12% 139ns ± 6% -35.71% (p=0.000 n=10+10) Format/x-16 170ns ±13% 120ns ± 2% -29.41% (p=0.000 n=10+10) Format/X-16 324ns ±11% 142ns ± 0% -56.24% (p=0.000 n=10+10) Format/v-16 156ns ± 4% 143ns ± 9% -8.51% (p=0.000 n=10+10) Format/+v-16 155ns ± 3% 141ns ± 8% -9.11% (p=0.000 n=10+10) Format/#v-16 894ns ± 1% 860ns ± 0% -3.84% (p=0.000 n=10+10) String-16 70.1ns ±36% 71.9ns ±22% ~ (p=0.393 n=10+10) FromBytes-16 1.81ns ± 0% 1.82ns ± 2% ~ (p=0.369 n=8+10) FromString/canonical-16 94.3ns ±20% 22.1ns ± 0% -76.53% (p=0.000 n=10+10) FromString/urn-16 93.7ns ±11% 22.4ns ± 0% -76.07% (p=0.000 n=10+10) FromString/braced-16 87.1ns ± 5% 22.6ns ± 0% -74.04% (p=0.000 n=9+10) MarshalBinary-16 0.20ns ± 3% 0.20ns ± 1% ~ (p=0.515 n=10+10) MarshalText-16 115ns ±25% 19ns ± 3% -83.09% (p=0.000 n=10+9) name old alloc/op new alloc/op delta UnmarshalText/canonical-16 0.00B 0.00B ~ (all equal) UnmarshalText/urn-16 0.00B 0.00B ~ (all equal) UnmarshalText/braced-16 0.00B 0.00B ~ (all equal) ParseV4-16 48.0B ± 0% 0.0B -100.00% (p=0.000 n=10+10) NullMarshalJSON/Valid-16 160B ± 0% 48B ± 0% -70.00% (p=0.000 n=10+10) NullMarshalJSON/Invalid-16 8.00B ± 0% 0.00B -100.00% (p=0.000 n=10+10) Format/s-16 48.0B ± 0% 48.0B ± 0% ~ (all equal) Format/S-16 96.0B ± 0% 48.0B ± 0% -50.00% (p=0.000 n=10+10) Format/q-16 96.0B ± 0% 48.0B ± 0% -50.00% (p=0.000 n=10+10) Format/x-16 64.0B ± 0% 32.0B ± 0% -50.00% (p=0.000 n=10+10) Format/X-16 112B ± 0% 32B ± 0% -71.43% (p=0.000 n=10+10) Format/v-16 48.0B ± 0% 48.0B ± 0% ~ (all equal) Format/+v-16 48.0B ± 0% 48.0B ± 0% ~ (all equal) Format/#v-16 128B ± 0% 16B ± 0% -87.50% (p=0.000 n=10+10) String-16 48.0B ± 0% 48.0B ± 0% ~ (all equal) FromBytes-16 0.00B 0.00B ~ (all equal) FromString/canonical-16 48.0B ± 0% 0.0B -100.00% (p=0.000 n=10+10) FromString/urn-16 48.0B ± 0% 0.0B -100.00% (p=0.000 n=10+10) FromString/braced-16 48.0B ± 0% 0.0B -100.00% (p=0.000 n=10+10) MarshalBinary-16 0.00B 0.00B ~ (all equal) MarshalText-16 96.0B ± 0% 0.0B -100.00% (p=0.000 n=10+10) name old allocs/op new allocs/op delta UnmarshalText/canonical-16 0.00 0.00 ~ (all equal) UnmarshalText/urn-16 0.00 0.00 ~ (all equal) UnmarshalText/braced-16 0.00 0.00 ~ (all equal) ParseV4-16 1.00 ± 0% 0.00 -100.00% (p=0.000 n=10+10) NullMarshalJSON/Valid-16 4.00 ± 0% 1.00 ± 0% -75.00% (p=0.000 n=10+10) NullMarshalJSON/Invalid-16 1.00 ± 0% 0.00 -100.00% (p=0.000 n=10+10) Format/s-16 1.00 ± 0% 1.00 ± 0% ~ (all equal) Format/S-16 2.00 ± 0% 1.00 ± 0% -50.00% (p=0.000 n=10+10) Format/q-16 2.00 ± 0% 1.00 ± 0% -50.00% (p=0.000 n=10+10) Format/x-16 2.00 ± 0% 1.00 ± 0% -50.00% (p=0.000 n=10+10) Format/X-16 3.00 ± 0% 1.00 ± 0% -66.67% (p=0.000 n=10+10) Format/v-16 1.00 ± 0% 1.00 ± 0% ~ (all equal) Format/+v-16 1.00 ± 0% 1.00 ± 0% ~ (all equal) Format/#v-16 2.00 ± 0% 1.00 ± 0% -50.00% (p=0.000 n=10+10) String-16 1.00 ± 0% 1.00 ± 0% ~ (all equal) FromBytes-16 0.00 0.00 ~ (all equal) FromString/canonical-16 1.00 ± 0% 0.00 -100.00% (p=0.000 n=10+10) FromString/urn-16 1.00 ± 0% 0.00 -100.00% (p=0.000 n=10+10) FromString/braced-16 1.00 ± 0% 0.00 -100.00% (p=0.000 n=10+10) MarshalBinary-16 0.00 0.00 ~ (all equal) MarshalText-16 2.00 ± 0% 0.00 -100.00% (p=0.000 n=10+10) ```
Configuration menu - View commit details
-
Copy full SHA for ebca088 - Browse repository at this point
Copy the full SHA ebca088View commit details
Commits on Jan 7, 2023
-
all: gofmt with Go 1.19 (#110)
Go 1.19 adds doc comments. This commit runs `gofmt` on all the code to update the comments. https://tip.golang.org/doc/go1.19#go-doc
Configuration menu - View commit details
-
Copy full SHA for 9363593 - Browse repository at this point
Copy the full SHA 9363593View commit details
Commits on Jan 23, 2023
-
Remove deprecated coverage pkg (#115)
Recently I found that a previous change not related to workflows is failing in my other PR #111 It is happening because the package [golang.org/x/tools/cmd/cover](https://pkg.go.dev/golang.org/x/tools/cmd/cover) is no longer active and marked as deprecated, that's why the test is falling ``` Run go get golang.org/x/tools/cmd/cover go get golang.org/x/tools/cmd/cover shell: /usr/bin/bash -e {0} env: GO111MODULE: auto GOROOT: /opt/hostedtoolcache/go/1.19.4/x64 cannot find package "golang.org/x/tools/cmd/cover" in any of: /opt/hostedtoolcache/go/1.19.4/x64/src/golang.org/x/tools/cmd/cover (from $GOROOT) /home/runner/go/src/golang.org/x/tools/cmd/cover (from $GOPATH) Error: Process completed with exit code 1. ``` The tests are focused on 1.18 e 1.19 we will be fine
Configuration menu - View commit details
-
Copy full SHA for 6ba114c - Browse repository at this point
Copy the full SHA 6ba114cView commit details -
Added a generator constructor that accepts options (#111)
* feat: add generator with options * fix: do not apply a nil option * fix: nil safe for generator's options * docs: enhance doc * fix: 100% coverage * fix: nil constructors * fix: with dummy generator * nil test * chore: add basic test to increase coverage * fix identation Co-authored-by: Cameron Ackerman <cameron_ackerman@selinc.com>
Configuration menu - View commit details
-
Copy full SHA for f1cfba7 - Browse repository at this point
Copy the full SHA f1cfba7View commit details -
Configuration menu - View commit details
-
Copy full SHA for 7b40032 - Browse repository at this point
Copy the full SHA 7b40032View commit details
Commits on Jan 26, 2023
-
Updated V7 generator to Draft04. (#112)
* Updated V7 generator to Draft04. * comment fixes * extend test coverage for failing new rand call * update readme * fix more comments
Configuration menu - View commit details
-
Copy full SHA for 8345c9a - Browse repository at this point
Copy the full SHA 8345c9aView commit details
This comparison is taking too long to generate.
Unfortunately it looks like we can’t render this comparison for you right now. It might be too big, or there might be something weird with your repository.
You can try running this command locally to see the comparison on your machine:
git diff v4.3.1...v4.4.0