Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 2 of 2 for BenchmarkShuffleOverhead (0.28 sec)

  1. src/math/rand/rand_test.go

    		p := make([]int, 30)
    		for i := range p {
    			p[i] = i
    		}
    		r.Shuffle(30, func(i, j int) { p[i], p[j] = p[j], p[i] })
    	}
    }
    
    // BenchmarkShuffleOverhead uses a minimal swap function
    // to measure just the shuffling overhead.
    func BenchmarkShuffleOverhead(b *testing.B) {
    	r := New(NewSource(1))
    	for n := b.N; n > 0; n-- {
    		r.Shuffle(52, func(i, j int) {
    			if i < 0 || i >= 52 || j < 0 || j >= 52 {
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu May 23 18:42:28 UTC 2024
    - 16.9K bytes
    - Viewed (0)
  2. src/math/rand/v2/rand_test.go

    		for i := range p {
    			p[i] = i
    		}
    		r.Shuffle(30, func(i, j int) { p[i], p[j] = p[j], p[i] })
    		t += p[0]
    	}
    	Sink = uint64(t)
    }
    
    // BenchmarkShuffleOverhead uses a minimal swap function
    // to measure just the shuffling overhead.
    func BenchmarkShuffleOverhead(b *testing.B) {
    	r := testRand()
    	for n := b.N; n > 0; n-- {
    		r.Shuffle(30, func(i, j int) {
    			if i < 0 || i >= 30 || j < 0 || j >= 30 {
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu May 23 18:42:28 UTC 2024
    - 17.4K bytes
    - Viewed (0)
Back to top