1
0
mirror of https://github.com/google/uuid.git synced 2024-11-30 08:57:04 +02:00
Commit Graph

15 Commits

Author SHA1 Message Date
Martin Lindhe
1f1ba6fb7a make 'go vet' happy 2017-11-22 06:14:10 +01:00
Charles Francoise
5c50970d1d add FromBytes constructor 2017-11-10 21:33:01 +01:00
Stéphane Jeandeaux
cdf9b51fe8 [test] compare two slices of bytes thanks @maknihamdi 2017-07-23 17:01:55 +02:00
Paul Borman
a34cdf67a6 Merge branch 'master' of https://github.com/google/uuid 2016-02-29 06:19:06 -08:00
Paul Borman
834b00a6a5 Bring naming of exported values inline with current Go practice. 2016-02-29 06:04:36 -08:00
Bryan Matsuo
7508f98c71 optimize internal parsing function -- avoid unsafe []byte parsing
Making xtob take two byte arguments avoids a lot of slicing.  This makes
the Parse function faster.  In addition, because so much slicing is
avoiding, duplicating the parse logic to ParseBytes resulted in the
function being faster than Parse (<1ns).

The BenchmarkParseBytesNative function has been removed (parseBytes was
identical to ParseBytes).  And a new benchmark,
BenchmarkParseBytesUnsafe, has been added to benchmark the old way of
parsing []byte (which is slightly slower than Parse and thus the new
ParseBytes implementation).

    benchmark                         old ns/op     new ns/op     delta
    BenchmarkUUID_MarshalJSON-4       685           667           -2.63%
    BenchmarkUUID_UnmarshalJSON-4     1145          1162          +1.48%
    BenchmarkParse-4                  61.6          56.5          -8.28%
    BenchmarkParseBytes-4             65.7          55.9          -14.92%
    BenchmarkParseBytesCopy-4         121           115           -4.96%
    BenchmarkNew-4                    1665          1643          -1.32%
    BenchmarkUUID_String-4            112           113           +0.89%
    BenchmarkUUID_URN-4               117           119           +1.71%

    benchmark                         old allocs     new allocs     delta
    BenchmarkUUID_MarshalJSON-4       4              4              +0.00%
    BenchmarkUUID_UnmarshalJSON-4     2              2              +0.00%
    BenchmarkParse-4                  0              0              +0.00%
    BenchmarkParseBytes-4             0              0              +0.00%
    BenchmarkParseBytesCopy-4         1              1              +0.00%
    BenchmarkNew-4                    1              1              +0.00%
    BenchmarkUUID_String-4            1              1              +0.00%
    BenchmarkUUID_URN-4               1              1              +0.00%

    benchmark                         old bytes     new bytes     delta
    BenchmarkUUID_MarshalJSON-4       248           248           +0.00%
    BenchmarkUUID_UnmarshalJSON-4     248           248           +0.00%
    BenchmarkParse-4                  0             0             +0.00%
    BenchmarkParseBytes-4             0             0             +0.00%
    BenchmarkParseBytesCopy-4         48            48            +0.00%
    BenchmarkNew-4                    16            16            +0.00%
    BenchmarkUUID_String-4            48            48            +0.00%
    BenchmarkUUID_URN-4               48            48            +0.00%
2016-02-25 21:48:37 -08:00
Paul Borman
9e951e1b07 Change a UUID from []byte to [16]byte along with other API changes. 2016-02-19 12:30:25 -08:00
Bryan Matsuo
6032e8b8f0 don't slice arrays to test their values 2016-02-11 12:26:40 -08:00
Bryan Matsuo
b4118685bb define Array type to convert UUIDs to/from map keys. 2016-02-11 12:00:09 -08:00
pborman
27e2c5ea7b Merge pull request #13 from bmatsuo/optimizations
Optimizations
2016-02-09 10:14:57 -08:00
Paul Borman
6cc520cd8b Fix govet issues and make node.go thread safe.
Includes changes from mischief and shawnps.
2016-02-09 09:58:31 -08:00
Bryan Matsuo
baeec2195c benchmarks for Parse(), New(), String(), URN(), MarshalJSON, UnmarshalJSON()
There are no parse modifications yet.  This allows a benchmark to be
established for later commits.
2015-10-10 21:12:07 -07:00
Paul Borman
2a573a0b4d Move code up one directory 2015-06-03 14:39:07 -07:00
Paul Borman
808d470594 uuid: source re-organization
Move source to uuid subdirectory.
Add in coderviewability.

R=rsc
CC=borman
http://codereview.appspot.com/4838053
2011-08-08 14:34:29 -07:00
Paul Borman
e130d97558 Initial checking of the go-uuid code. 2011-08-08 11:45:10 -07:00