Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 4 of 4 for benchFunc (0.22 sec)

  1. src/testing/benchmark.go

    	// by clearing garbage from previous runs.
    	runtime.GC()
    	b.resetRaces()
    	b.N = n
    	b.parallelism = 1
    	b.ResetTimer()
    	b.StartTimer()
    	b.benchFunc(b)
    	b.StopTimer()
    	b.previousN = n
    	b.previousDuration = b.duration
    }
    
    // run1 runs the first iteration of benchFunc. It reports whether more
    // iterations of this benchmarks should be run.
    func (b *B) run1() bool {
    	if ctx := b.context; ctx != nil {
    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/encoding/base64/base64_test.go

    	sizes := []int{2, 4, 8, 64, 8192}
    	benchFunc := func(b *testing.B, benchSize int) {
    		data := StdEncoding.EncodeToString(make([]byte, benchSize))
    		b.SetBytes(int64(len(data)))
    		b.ResetTimer()
    		for i := 0; i < b.N; i++ {
    			StdEncoding.DecodeString(data)
    		}
    	}
    	for _, size := range sizes {
    		b.Run(fmt.Sprintf("%d", size), func(b *testing.B) {
    			benchFunc(b, size)
    		})
    	}
    }
    
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Sun Sep 03 18:57:29 UTC 2023
    - 15.9K bytes
    - Viewed (0)
  3. src/strings/strings_test.go

    		(indexSizes[len(indexSizes)-1]+len(benchmarkString)-1)/len(benchmarkString))
    	benchFunc := func(b *testing.B, benchStr string) {
    		b.SetBytes(int64(len(benchStr)))
    		for i := 0; i < b.N; i++ {
    			Count(benchStr, "=")
    		}
    	}
    	for _, size := range indexSizes {
    		b.Run(fmt.Sprintf("%d", size), func(b *testing.B) {
    			benchFunc(b, benchStr[:size])
    		})
    	}
    
    }
    
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Fri May 03 12:58:37 UTC 2024
    - 53K bytes
    - Viewed (0)
  4. src/testing/sub_test.go

    			// the benchtime and catch the failure result of the subbenchmark.
    			root := &B{
    				common: common{
    					signal: make(chan bool),
    					name:   "root",
    					w:      buf,
    				},
    				benchFunc: func(b *B) { ok = b.Run("test", tc.f) }, // Use Run to catch failure.
    				benchTime: durationOrCountFlag{d: 1 * time.Microsecond},
    			}
    			if tc.chatty {
    				root.chatty = newChattyPrinter(root.w)
    			}
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Fri Dec 01 21:27:08 UTC 2023
    - 23.8K bytes
    - Viewed (0)
Back to top