MCPcopy
hub / github.com/ory/keto / BenchmarkReadOnlyMapper

Function BenchmarkReadOnlyMapper

internal/relationtuple/uuid_mapping_test.go:352–373  ·  view source on GitHub ↗
(b *testing.B)

Source from the content-addressed store, hash-verified

350}
351
352func BenchmarkReadOnlyMapper(b *testing.B) {
353 ctx := context.Background()
354 reg := driver.NewSqliteTestRegistry(b, false,
355 driver.WithNamespaces([]*namespace.Namespace{{Name: "test"}}))
356 m := reg.ReadOnlyMapper()
357
358 b.Run("FromTuple", func(b *testing.B) {
359 for i := 0; i < b.N; i++ {
360 _, err := m.FromTuple(ctx, &ketoapi.RelationTuple{
361 Namespace: "test",
362 Object: "object",
363 Relation: "relation",
364 SubjectSet: &ketoapi.SubjectSet{
365 Namespace: "test",
366 Object: "subject object",
367 Relation: "relation",
368 },
369 })
370 assert.NoError(b, err)
371 }
372 })
373}

Callers

nothing calls this directly

Calls 4

NewSqliteTestRegistryFunction · 0.92
WithNamespacesFunction · 0.92
FromTupleMethod · 0.80
ReadOnlyMapperMethod · 0.65

Tested by

no test coverage detected