Search Options

Results per page
Sort
Preferred Languages
Advance

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

  1. src/internal/runtime/atomic/bench_test.go

    	var x [512]uint8 // give byte its own cache line
    	sink = &x
    	b.RunParallel(func(pb *testing.PB) {
    		i := uint8(0)
    		for pb.Next() {
    			atomic.And8(&x[255], i)
    			i++
    		}
    	})
    }
    
    func BenchmarkAndParallel(b *testing.B) {
    	var x [128]uint32 // give x its own cache line
    	sink = &x
    	b.RunParallel(func(pb *testing.PB) {
    		i := uint32(0)
    		for pb.Next() {
    			atomic.And(&x[63], i)
    			i++
    		}
    	})
    }
    
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Mon Mar 25 19:53:03 UTC 2024
    - 3.2K bytes
    - Viewed (0)
Back to top