MCPcopy Create free account
hub / github.com/dop251/goja / BenchmarkAddString

Function BenchmarkAddString

object_test.go:650–668  ·  view source on GitHub ↗
(b *testing.B)

Source from the content-addressed store, hash-verified

648}
649
650func BenchmarkAddString(b *testing.B) {
651 var x, y Value
652
653 tst := asciiString("22")
654 x = asciiString("2")
655 y = asciiString("2")
656
657 for i := 0; i < b.N; i++ {
658 var z Value
659 if xi, ok := x.(String); ok {
660 if yi, ok := y.(String); ok {
661 z = xi.Concat(yi)
662 }
663 }
664 if !z.StrictEquals(tst) {
665 b.Fatalf("Unexpected result %v", x)
666 }
667 }
668}

Callers

nothing calls this directly

Calls 3

StrictEqualsMethod · 0.95
asciiStringTypeAlias · 0.85
ConcatMethod · 0.65

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…