MCPcopy Create free account
hub / github.com/EngoEngine/ecs / Bench

Function Bench

entity_test.go:485–496  ·  view source on GitHub ↗

Bench is a helper-function to easily benchmark one frame, given a preload / setup function

(b *testing.B, preload func(), setup func(w *World))

Source from the content-addressed store, hash-verified

483
484// Bench is a helper-function to easily benchmark one frame, given a preload / setup function
485func Bench(b *testing.B, preload func(), setup func(w *World)) {
486 w := &World{}
487
488 preload()
489 setup(w)
490
491 b.ResetTimer()
492 b.ReportAllocs()
493 for i := 0; i < b.N; i++ {
494 w.Update(1 / 120) // 120 fps
495 }
496}
497
498func BenchmarkNewBasic(b *testing.B) {
499 for i := 0; i < b.N; i++ {

Callers 2

BenchmarkIdiomaticFunction · 0.85
BenchmarkIdiomaticDoubleFunction · 0.85

Calls 1

UpdateMethod · 0.95

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…