MCPcopy Create free account
hub / github.com/benbjohnson/immutable / BenchmarkList_Set

Function BenchmarkList_Set

immutable_test.go:414–427  ·  view source on GitHub ↗
(b *testing.B)

Source from the content-addressed store, hash-verified

412}
413
414func BenchmarkList_Set(b *testing.B) {
415 const n = 10000
416
417 l := NewList[int]()
418 for i := 0; i < 10000; i++ {
419 l = l.Append(i)
420 }
421 b.ReportAllocs()
422 b.ResetTimer()
423
424 for i := 0; i < b.N; i++ {
425 l = l.Set(i%n, i*10)
426 }
427}
428
429func BenchmarkList_Iterator(b *testing.B) {
430 const n = 10000

Callers

nothing calls this directly

Calls 2

AppendMethod · 0.45
SetMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…