MCPcopy Create free account
hub / github.com/GoMudEngine/GoMud / BenchmarkAddUser

Function BenchmarkAddUser

internal/users/index_test.go:102–111  ·  view source on GitHub ↗
(b *testing.B)

Source from the content-addressed store, hash-verified

100}
101
102func BenchmarkAddUser(b *testing.B) {
103 filename, cleanup := benchTempFile(b)
104 defer cleanup()
105 idx := &UserIndex{Filename: filename}
106 idx.Create()
107 b.ResetTimer()
108 for i := 0; i < b.N; i++ {
109 idx.AddUser(i, fmt.Sprintf("bench_user_%d", i))
110 }
111}
112
113func BenchmarkRemoveByUsername(b *testing.B) {
114 filename, cleanup := benchTempFile(b)

Callers

nothing calls this directly

Calls 3

CreateMethod · 0.95
AddUserMethod · 0.95
benchTempFileFunction · 0.85

Tested by

no test coverage detected