MCPcopy
hub / github.com/google/mangle / BenchmarkIntervalCoalesce

Function BenchmarkIntervalCoalesce

engine/temporal_test.go:620–635  ·  view source on GitHub ↗
(b *testing.B)

Source from the content-addressed store, hash-verified

618}
619
620func BenchmarkIntervalCoalesce(b *testing.B) {
621 for i := 0; i < b.N; i++ {
622 store := factstore.NewTemporalStore()
623
624 // Add overlapping intervals
625 pred, _ := ast.Name("/test")
626 for j := 0; j < 100; j++ {
627 store.Add(ast.NewAtom("status", pred), ast.TimeInterval(
628 time.Date(2024, 1, 1+j, 0, 0, 0, 0, time.UTC),
629 time.Date(2024, 1, 3+j, 0, 0, 0, 0, time.UTC),
630 ))
631 }
632
633 store.Coalesce(ast.PredicateSym{Symbol: "status", Arity: 1})
634 }
635}
636
637// Tests for derived temporal facts (rules that produce temporal facts)
638

Callers

nothing calls this directly

Calls 6

AddMethod · 0.95
CoalesceMethod · 0.95
NewTemporalStoreFunction · 0.92
NameFunction · 0.92
NewAtomFunction · 0.92
TimeIntervalFunction · 0.92

Tested by

no test coverage detected