- Sort Score
- Result 10 results
- Languages All
Results 1 - 1 of 1 for BenchmarkScanSlice (0.16 sec)
-
tests/benchmark_test.go
user := *GetUser("scan", Config{}) DB.Create(&user) var u User b.ResetTimer() for x := 0; x < b.N; x++ { DB.Raw("select * from users where id = ?", user.ID).Scan(&u) } } func BenchmarkScanSlice(b *testing.B) { DB.Exec("delete from users") for i := 0; i < 10_000; i++ { user := *GetUser(fmt.Sprintf("scan-%d", i), Config{}) DB.Create(&user) } var u []User b.ResetTimer()
Registered: Sun Nov 03 09:35:10 UTC 2024 - Last Modified: Wed Jun 01 03:50:57 UTC 2022 - 1.5K bytes - Viewed (0)