| 88 | } |
| 89 | |
| 90 | func BenchmarkBitmask(b *testing.B) { |
| 91 | b.ReportAllocs() |
| 92 | |
| 93 | bm := bitmask.New() |
| 94 | bm.Set(TerminateThread.ID()) |
| 95 | bm.Set(CreateThread.ID()) |
| 96 | bm.Set(TerminateProcess.ID()) |
| 97 | bm.Set(CreateFile.ID()) |
| 98 | |
| 99 | evt := &etw.EventRecord{Header: etw.EventHeader{ProviderID: ThreadEventGUID, EventDescriptor: etw.EventDescriptor{Opcode: 2}}} |
| 100 | |
| 101 | b.ResetTimer() |
| 102 | |
| 103 | for i := 0; i < b.N; i++ { |
| 104 | if !bm.IsSet(evt.ID()) { |
| 105 | panic("mask should be present") |
| 106 | } |
| 107 | } |
| 108 | } |
| 109 | |
| 110 | func BenchmarkStdlibMap(b *testing.B) { |
| 111 | b.ReportAllocs() |