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

Function BenchmarkQueryWorkingSetBatch64Pages

pkg/util/va/ws_test.go:487–507  ·  view source on GitHub ↗
(b *testing.B)

Source from the content-addressed store, hash-verified

485}
486
487func BenchmarkQueryWorkingSetBatch64Pages(b *testing.B) {
488 const pageSize = 4096
489 const pages = 64
490
491 addr, err := windows.VirtualAlloc(0, pageSize*pages, windows.MEM_COMMIT|windows.MEM_RESERVE, windows.PAGE_READWRITE)
492 if err != nil {
493 b.Fatalf("VirtualAlloc failed: %v", err)
494 }
495 defer windows.VirtualFree(addr, 0, windows.MEM_RELEASE)
496
497 ws := make([]sys.MemoryWorkingSetExInformation, pages)
498 for i := range ws {
499 ws[i].VirtualAddress = addr + uintptr(i*pageSize)
500 }
501 proc := windows.CurrentProcess()
502
503 b.ResetTimer()
504 for i := 0; i < b.N; i++ {
505 QueryWorkingSet(proc, ws)
506 }
507}

Callers

nothing calls this directly

Calls 1

QueryWorkingSetFunction · 0.70

Tested by

no test coverage detected