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

Function BenchmarkListBuilder_Set

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

Source from the content-addressed store, hash-verified

490}
491
492func BenchmarkListBuilder_Set(b *testing.B) {
493 const n = 10000
494
495 builder := NewListBuilder[int]()
496 for i := 0; i < 10000; i++ {
497 builder.Append(i)
498 }
499 b.ReportAllocs()
500 b.ResetTimer()
501
502 for i := 0; i < b.N; i++ {
503 builder.Set(i%n, i*10)
504 }
505}
506
507func ExampleList_Append() {
508 l := NewList[string]()

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…