Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 3 of 3 for applyGCLoad (0.18 sec)

  1. src/runtime/gc_test.go

    	for i := range x {
    		x[i] = new([1024]byte)
    	}
    
    	b.ResetTimer()
    	for i := 0; i < b.N; i++ {
    		runtime.ReadMemStats(&ms)
    	}
    
    	runtime.KeepAlive(x)
    }
    
    func applyGCLoad(b *testing.B) func() {
    	// We’ll apply load to the runtime with maxProcs-1 goroutines
    	// and use one more to actually benchmark. It doesn't make sense
    	// to try to run this test with only 1 P (that's what
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Wed Jun 05 22:33:52 UTC 2024
    - 17.6K bytes
    - Viewed (0)
  2. src/runtime/runtime_test.go

    			b.ReportMetric(float64(latencies[len(latencies)*99/100]), "p99-ns")
    		}
    		return func(b *testing.B) {
    			b.Run("idle", runOne)
    
    			b.Run("loaded", func(b *testing.B) {
    				stop := applyGCLoad(b)
    				runOne(b)
    				// Make sure to stop the timer before we wait! The load created above
    				// is very heavy-weight and not easy to stop, so we could end up
    				// confusing the benchmarking framework for small b.N.
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu May 23 01:00:11 UTC 2024
    - 11.7K bytes
    - Viewed (0)
  3. src/runtime/metrics_test.go

    		t.Errorf("/gc/scan/total:bytes doesn't line up with sum of /gc/scan*: total %d vs. sum %d", totalScan.got, totalScan.want)
    	}
    }
    
    func BenchmarkReadMetricsLatency(b *testing.B) {
    	stop := applyGCLoad(b)
    
    	// Spend this much time measuring latencies.
    	latencies := make([]time.Duration, 0, 1024)
    	_, samples := prepareAllMetricsSamples()
    
    	// Hit metrics.Read continuously and measure.
    	b.ResetTimer()
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu May 30 17:52:17 UTC 2024
    - 45K bytes
    - Viewed (0)
Back to top