Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 1 of 1 for BenchmarkCountSingle (0.12 sec)

  1. src/bytes/bytes_test.go

    		buf[n-7] = 'x'
    		for i := 0; i < b.N; i++ {
    			j := Count(buf, buf[n-7:])
    			if j != 1 {
    				b.Fatal("bad count", j)
    			}
    		}
    		buf[n-1] = '\x00'
    		buf[n-7] = '\x00'
    	})
    }
    
    func BenchmarkCountSingle(b *testing.B) {
    	benchBytes(b, indexSizes, func(b *testing.B, n int) {
    		buf := bmbuf[0:n]
    		step := 8
    		for i := 0; i < len(buf); i += step {
    			buf[i] = 1
    		}
    		expect := (len(buf) + (step - 1)) / step
    Registered: Tue Nov 05 11:13:11 UTC 2024
    - Last Modified: Mon Aug 19 19:09:04 UTC 2024
    - 61.2K bytes
    - Viewed (0)
Back to top