MCPcopy Index your code
hub / github.com/devfeel/mapper / BenchmarkObjectMapperMap

Function BenchmarkObjectMapperMap

mapper_object_test.go:451–464  ·  view source on GitHub ↗
(b *testing.B)

Source from the content-addressed store, hash-verified

449}
450
451func BenchmarkObjectMapperMap(b *testing.B) {
452 m := NewMapper()
453 m.Register(&testStruct{})
454 fromMap := make(map[string]interface{})
455 fromMap["Name"] = "test"
456 fromMap["Sex"] = true
457 fromMap["Age"] = 10
458 fromMap["time"] = time.Now()
459 toObj := &testStruct{}
460
461 for i := 0; i < b.N; i++ {
462 m.MapperMap(fromMap, toObj)
463 }
464}
465
466func BenchmarkObjectSyncMap(b *testing.B) {
467 var sMap sync.Map

Callers

nothing calls this directly

Calls 3

NewMapperFunction · 0.85
RegisterMethod · 0.65
MapperMapMethod · 0.65

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…