github.com/xhebox/bstruct@v0.0.0-20221115052913-86d4d6d98866/README.md (about)

     1  # bstruct
     2  
     3  zero-copy, pre-generated binary encoder/decoder in golang with customization.
     4  
     5  ## performance
     6  
     7  
     8  ```
     9  type Struct1 struct {
    10  	A	bool
    11  	B	[]bool
    12  	C	Struct2
    13  	D	string
    14  	G	[]string
    15  	E	Slice1
    16  	F	bool
    17  }
    18  type Struct2 struct {
    19  	A bool
    20  }
    21  type Slice1 []struct {
    22  	E string
    23  }
    24  ```
    25  
    26  ```
    27  BenchmarkEncode-8      	17996954	        67.08 ns/op	      48 B/op	       2 allocs/op
    28  BenchmarkMarshal-8     	 3224440	       372.8 ns/op	      96 B/op	       1 allocs/op
    29  BenchmarkDecode-8      	22132478	        53.78 ns/op	      48 B/op	       1 allocs/op
    30  BenchmarkUnmarshal-8   	  791223	      1493 ns/op	     272 B/op	       7 allocs/op
    31  ```