- Sort Score
- Result 10 results
- Languages All
Results 1 - 10 of 2,047 for Mallocs (0.24 sec)
-
src/testing/allocs.go
var memstats runtime.MemStats runtime.ReadMemStats(&memstats) mallocs := 0 - memstats.Mallocs // Run the function the specified number of times for i := 0; i < runs; i++ { f() } // Read the final statistics runtime.ReadMemStats(&memstats) mallocs += memstats.Mallocs // Average the mallocs over the runs (not counting the warm-up).
Registered: Wed Jun 12 16:32:35 UTC 2024 - Last Modified: Wed Mar 02 00:13:47 UTC 2016 - 1.4K bytes - Viewed (0) -
test/closure.go
memstats := new(runtime.MemStats) runtime.ReadMemStats(memstats) n0 := memstats.Mallocs x, y := newfunc(), newfunc() if x(1) != 1 || y(2) != 2 { println("newfunc returned broken funcs") fail = true } runtime.ReadMemStats(memstats) if n0 != memstats.Mallocs { println("newfunc allocated unexpectedly") fail = true } ff(1) if fail {
Registered: Wed Jun 12 16:32:35 UTC 2024 - Last Modified: Sun Jul 01 17:59:50 UTC 2012 - 1.7K bytes - Viewed (0) -
pkg/ctrlz/topics/assets/templates/mem.html
<tr> <td>Lookups</td> <td id="Lookups">{{.Lookups}} lookups</td> <td>Number of pointer lookups performed by the runtime.</td> </tr> <tr> <td>Mallocs</td> <td id="Mallocs">{{.Mallocs}} objects</td> <td>Cumulative count of heap objects allocated.</td> </tr> <tr> <td>Frees</td> <td id="Frees">{{.Frees}} objects</td>
Registered: Fri Jun 14 15:00:06 UTC 2024 - Last Modified: Tue May 23 17:08:31 UTC 2023 - 7.2K bytes - Viewed (0) -
src/net/http/internal/chunked_test.go
} if err != io.ErrUnexpectedEOF { t.Fatalf("read error = %v; want ErrUnexpectedEOF", err) } }) if mallocs > 1.5 { t.Errorf("mallocs = %v; want 1", mallocs) } } func TestParseHexUint(t *testing.T) { type testCase struct { in string want uint64 wantErr string } tests := []testCase{ {"x", 0, "invalid byte in chunk length"},
Registered: Wed Jun 12 16:32:35 UTC 2024 - Last Modified: Thu Jan 04 20:45:19 UTC 2024 - 8K bytes - Viewed (0) -
src/runtime/mstats.go
// Size is the maximum byte size of an object in this // size class. Size uint32 // Mallocs is the cumulative count of heap objects // allocated in this size class. The cumulative bytes // of allocation is Size*Mallocs. The number of live // objects in this size class is Mallocs - Frees. Mallocs uint64 // Frees is the cumulative count of heap objects freed // in this size class. Frees uint64
Registered: Wed Jun 12 16:32:35 UTC 2024 - Last Modified: Mon Apr 08 21:03:13 UTC 2024 - 34.2K bytes - Viewed (0) -
cmd/admin-server-info.go
Endpoint: addr, Uptime: UTCNow().Unix() - globalBootTime.Unix(), Version: Version, CommitID: CommitID, Network: network, MemStats: madmin.MemStats{ Alloc: memstats.Alloc, TotalAlloc: memstats.TotalAlloc, Mallocs: memstats.Mallocs, Frees: memstats.Frees, HeapAlloc: memstats.HeapAlloc, }, GoMaxProcs: runtime.GOMAXPROCS(0), NumCPU: runtime.NumCPU(),
Registered: Sun Jun 16 00:44:34 UTC 2024 - Last Modified: Fri May 24 23:05:23 UTC 2024 - 4.9K bytes - Viewed (0) -
src/cmd/link/internal/benchmark/bench.go
fmt.Fprintf(w, "%s 1 %d ns/op", makeBenchString(curMark.name+gcString), dur.Nanoseconds()) fmt.Fprintf(w, "\t%d B/op", curMark.endM.TotalAlloc-curMark.startM.TotalAlloc) fmt.Fprintf(w, "\t%d allocs/op", curMark.endM.Mallocs-curMark.startM.Mallocs) if m.gc == GC { fmt.Fprintf(w, "\t%d live-B", curMark.gcM.HeapAlloc) } else { fmt.Fprintf(w, "\t%d heap-B", curMark.endM.HeapAlloc) } fmt.Fprintf(w, "\n") }
Registered: Wed Jun 12 16:32:35 UTC 2024 - Last Modified: Mon Jan 30 18:10:36 UTC 2023 - 4.7K bytes - Viewed (0) -
src/encoding/gob/timing_test.go
if err != nil { t.Fatal("encode:", err) } }) dec := NewDecoder(&buf) allocs := testing.AllocsPerRun(N, func() { *bench = Bench{} err := dec.Decode(&bench) if err != nil { t.Fatal("decode:", err) } }) if allocs != 3 { t.Fatalf("mallocs per decode of type Bench: %v; wanted 3\n", allocs) } } func benchmarkEncodeSlice(b *testing.B, a any) { b.ResetTimer()
Registered: Wed Jun 12 16:32:35 UTC 2024 - Last Modified: Tue Apr 04 07:16:59 UTC 2023 - 6.5K bytes - Viewed (0) -
src/runtime/metrics_test.go
t.Error("allocs-by-size and frees-by-size counts don't match in length") } else { for i := range objects.alloc.Buckets { ba := objects.alloc.Buckets[i] bf := objects.free.Buckets[i] if ba != bf { t.Errorf("bucket %d is different for alloc and free hists: %f != %f", i, ba, bf) } } if !t.Failed() { var gotAlloc, gotFree uint64 want := objects.total for i := range objects.alloc.Counts {
Registered: Wed Jun 12 16:32:35 UTC 2024 - Last Modified: Thu May 30 17:52:17 UTC 2024 - 45K bytes - Viewed (0) -
src/testing/benchmark.go
return 0 } return (float64(r.Bytes) * float64(r.N) / 1e6) / r.T.Seconds() } // AllocsPerOp returns the "allocs/op" metric, // which is calculated as r.MemAllocs / r.N. func (r BenchmarkResult) AllocsPerOp() int64 { if v, ok := r.Extra["allocs/op"]; ok { return int64(v) } if r.N <= 0 { return 0 } return int64(r.MemAllocs) / int64(r.N) }
Registered: Wed Jun 12 16:32:35 UTC 2024 - Last Modified: Thu May 23 01:00:11 UTC 2024 - 23.9K bytes - Viewed (0)