MCPcopy Create free account
hub / github.com/rabbitstack/fibratus / BenchmarkBitmask

Function BenchmarkBitmask

pkg/event/bitset_test.go:90–108  ·  view source on GitHub ↗
(b *testing.B)

Source from the content-addressed store, hash-verified

88}
89
90func 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
110func BenchmarkStdlibMap(b *testing.B) {
111 b.ReportAllocs()

Callers

nothing calls this directly

Calls 5

IDMethod · 0.95
NewFunction · 0.92
IsSetMethod · 0.80
SetMethod · 0.65
IDMethod · 0.45

Tested by

no test coverage detected