Search Options

Results per page
Sort
Preferred Languages
Advance

Results 11 - 20 of 2,047 for Mallocs (0.52 sec)

  1. 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)
  2. src/runtime/export_test.go

    			bySize[i].Frees += m.smallFreeCount[i]
    			bySize[i].Mallocs += m.smallFreeCount[i]
    			smallFree += m.smallFreeCount[i] * uint64(class_to_size[i])
    		}
    		slow.Frees += m.tinyAllocCount + m.largeFreeCount
    		slow.Mallocs += slow.Frees
    
    		slow.TotalAlloc = slow.Alloc + m.largeFree + smallFree
    
    		for i := range slow.BySize {
    			slow.BySize[i].Mallocs = bySize[i].Mallocs
    			slow.BySize[i].Frees = bySize[i].Frees
    		}
    
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu May 30 17:50:53 UTC 2024
    - 46.1K bytes
    - Viewed (0)
  3. src/time/tick_test.go

    			runtime.GC()
    			runtime.GC()
    			runtime.GC()
    			runtime.ReadMemStats(&stats)
    			before := int64(stats.Mallocs - stats.Frees)
    
    			for j := 0; j < N; j++ {
    				f()
    			}
    
    			runtime.GC()
    			runtime.GC()
    			runtime.GC()
    			runtime.ReadMemStats(&stats)
    			after := int64(stats.Mallocs - stats.Frees)
    
    			// Allow some slack, but inuse >= N means at least 1 allocation per iteration.
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Tue Jun 11 17:10:37 UTC 2024
    - 14.7K bytes
    - Viewed (0)
  4. src/net/rpc/server_test.go

    func TestCountMallocs(t *testing.T) {
    	if testing.Short() {
    		t.Skip("skipping malloc count in short mode")
    	}
    	if runtime.GOMAXPROCS(0) > 1 {
    		t.Skip("skipping; GOMAXPROCS>1")
    	}
    	fmt.Printf("mallocs per rpc round trip: %v\n", countMallocs(dialDirect, t))
    }
    
    func TestCountMallocsOverHTTP(t *testing.T) {
    	if testing.Short() {
    		t.Skip("skipping malloc count in short mode")
    	}
    	if runtime.GOMAXPROCS(0) > 1 {
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Tue Jul 18 05:23:29 UTC 2023
    - 19K bytes
    - Viewed (0)
  5. src/runtime/malloc_test.go

    		}
    	}
    	// Of the uint fields, HeapReleased, HeapIdle can be 0.
    	// PauseTotalNs can be 0 if timer resolution is poor.
    	fields := map[string][]func(any) error{
    		"Alloc": {nz, le(1e10)}, "TotalAlloc": {nz, le(1e11)}, "Sys": {nz, le(1e10)},
    		"Lookups": {eq(uint64(0))}, "Mallocs": {nz, le(1e10)}, "Frees": {nz, le(1e10)},
    		"HeapAlloc": {nz, le(1e10)}, "HeapSys": {nz, le(1e10)}, "HeapIdle": {le(1e10)},
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Tue Sep 05 23:35:29 UTC 2023
    - 10.6K bytes
    - Viewed (0)
  6. src/runtime/mprof.go

    	// The following complex 3-stage scheme of stats accumulation
    	// is required to obtain a consistent picture of mallocs and frees
    	// for some point in time.
    	// The problem is that mallocs come in real time, while frees
    	// come only after a GC during concurrent sweeping. So if we would
    	// naively count them, we would get a skew toward mallocs.
    	//
    	// Hence, we delay information to get consistent snapshots as
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu May 30 17:57:37 UTC 2024
    - 53.3K bytes
    - Viewed (0)
  7. src/runtime/pprof/pprof.go

    	// Pprof will ignore, but useful for people
    	s := memStats
    	fmt.Fprintf(w, "\n# runtime.MemStats\n")
    	fmt.Fprintf(w, "# Alloc = %d\n", s.Alloc)
    	fmt.Fprintf(w, "# TotalAlloc = %d\n", s.TotalAlloc)
    	fmt.Fprintf(w, "# Sys = %d\n", s.Sys)
    	fmt.Fprintf(w, "# Lookups = %d\n", s.Lookups)
    	fmt.Fprintf(w, "# Mallocs = %d\n", s.Mallocs)
    	fmt.Fprintf(w, "# Frees = %d\n", s.Frees)
    
    	fmt.Fprintf(w, "# HeapAlloc = %d\n", s.HeapAlloc)
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu May 30 17:52:17 UTC 2024
    - 30.6K bytes
    - Viewed (0)
  8. src/runtime/heapdump.go

    	// These ints should be identical to the exported
    	// MemStats structure and should be ordered the same
    	// way too.
    	dumpint(tagMemStats)
    	dumpint(m.Alloc)
    	dumpint(m.TotalAlloc)
    	dumpint(m.Sys)
    	dumpint(m.Lookups)
    	dumpint(m.Mallocs)
    	dumpint(m.Frees)
    	dumpint(m.HeapAlloc)
    	dumpint(m.HeapSys)
    	dumpint(m.HeapIdle)
    	dumpint(m.HeapInuse)
    	dumpint(m.HeapReleased)
    	dumpint(m.HeapObjects)
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Tue Apr 09 04:07:57 UTC 2024
    - 17.6K bytes
    - Viewed (0)
  9. src/runtime/trace.go

    		// Finish off CPU profile reading.
    		traceStopReadCPU()
    
    		// Reset debug.malloc if necessary. Note that this is set in a racy
    		// way; that's OK. Some mallocs may still enter into the debug.malloc
    		// block, but they won't generate events because tracing is disabled.
    		// That is, it's OK if mallocs read a stale debug.malloc or
    		// trace.enabledWithAllocFree value.
    		if trace.enabledWithAllocFree {
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Wed May 22 21:17:41 UTC 2024
    - 37.1K bytes
    - Viewed (0)
  10. src/internal/reflectlite/all_test.go

    func noAlloc(t *testing.T, n int, f func(int)) {
    	if testing.Short() {
    		t.Skip("skipping malloc count in short mode")
    	}
    	if runtime.GOMAXPROCS(0) > 1 {
    		t.Skip("skipping; GOMAXPROCS>1")
    	}
    	i := -1
    	allocs := testing.AllocsPerRun(n, func() {
    		f(i)
    		i++
    	})
    	if allocs > 0 {
    		t.Errorf("%d iterations: got %v mallocs, want 0", n, allocs)
    	}
    }
    
    func TestAllocations(t *testing.T) {
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu Nov 16 19:26:08 UTC 2023
    - 24.2K bytes
    - Viewed (0)
Back to top