Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 1 of 1 for BenchmarkExtendSlice (0.21 sec)

  1. src/runtime/slice_test.go

    			for i := 0; i < b.N; i++ {
    				_ = append([]struct40(nil), x...)
    			}
    		})
    
    	})
    }
    
    var (
    	SinkIntSlice        []int
    	SinkIntPointerSlice []*int
    )
    
    func BenchmarkExtendSlice(b *testing.B) {
    	var length = 4 // Use a variable to prevent stack allocation of slices.
    	b.Run("IntSlice", func(b *testing.B) {
    		s := make([]int, 0, length)
    		for i := 0; i < b.N; i++ {
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Mon Aug 17 09:45:44 UTC 2020
    - 10.3K bytes
    - Viewed (0)
Back to top