Skip to content

Commit

Permalink
Make unmarshal bench data more realistic (#148)
Browse files Browse the repository at this point in the history
  • Loading branch information
at-wat authored Feb 17, 2021
1 parent 1d0de7b commit 1c79946
Showing 1 changed file with 20 additions and 2 deletions.
22 changes: 20 additions & 2 deletions unmarshal_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -593,15 +593,33 @@ func BenchmarkUnmarshal(b *testing.B) {
TestBinary := []byte{
0x1a, 0x45, 0xdf, 0xa3, // EBML
0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x10, // 0x10
0x42, 0x82, 0x85, 0x77, 0x65, 0x62, 0x6d, 0x00,
0x42, 0x87, 0x81, 0x02, 0x42, 0x85, 0x81, 0x02,
0x42, 0x82, 0x85, 0x77, 0x65, 0x62, 0x6d, 0x00, // DocType = webm
0x42, 0x87, 0x81, 0x02, // DocTypeVersion = 2
0x42, 0x85, 0x81, 0x02, // DocTypeReadVersion = 2
0x18, 0x53, 0x80, 0x67, 0xFF, // Segment
0x1F, 0x43, 0xB6, 0x75, 0xFF, // Cluster
0xE7, 0x81, 0x00, // Timecode
0xA3, 0x86, 0x81, 0x00, 0x00, 0x88, 0xAA, 0xCC, // SimpleBlock
0xA3, 0x86, 0x81, 0x00, 0x10, 0x88, 0xAA, 0xCC, // SimpleBlock
0xA3, 0x86, 0x81, 0x00, 0x20, 0x88, 0xAA, 0xCC, // SimpleBlock
0x1F, 0x43, 0xB6, 0x75, 0xFF, // Cluster
0xE7, 0x81, 0x10, // Timecode
0xA3, 0x86, 0x81, 0x00, 0x00, 0x88, 0xAA, 0xCC, // SimpleBlock
0xA3, 0x86, 0x81, 0x00, 0x10, 0x88, 0xAA, 0xCC, // SimpleBlock
0xA3, 0x86, 0x81, 0x00, 0x20, 0x88, 0xAA, 0xCC, // SimpleBlock
}
type TestEBML struct {
Header struct {
DocType string `ebml:"EBMLDocType"`
DocTypeVersion uint64 `ebml:"EBMLDocTypeVersion"`
DocTypeReadVersion uint64 `ebml:"EBMLDocTypeReadVersion"`
} `ebml:"EBML"`
Segment []struct {
Cluster struct {
Timecode uint64
SimpleBlock []Block
}
}
}

var ret TestEBML
Expand Down

0 comments on commit 1c79946

Please sign in to comment.