Search Options

Results per page
Sort
Preferred Languages
Advance

Results 51 - 60 of 263 for resetTime (0.26 sec)

  1. pkg/cache/cache_test.go

    	}
    	wg.Wait()
    }
    
    func benchmarkCacheSet(c Cache, b *testing.B) {
    	b.ResetTimer()
    	for i := 0; i < b.N; i++ {
    		c.Set("foo", "bar")
    	}
    }
    
    func benchmarkCacheSetConcurrent(c Cache, b *testing.B) {
    	wg := new(sync.WaitGroup)
    	workers := runtime.NumCPU()
    	each := b.N / workers
    	wg.Add(workers)
    
    	b.ResetTimer()
    	for i := 0; i < workers; i++ {
    		go func() {
    			for j := 0; j < each; j++ {
    Registered: Fri Jun 14 15:00:06 UTC 2024
    - Last Modified: Wed May 24 15:56:49 UTC 2023
    - 8.5K bytes
    - Viewed (0)
  2. src/runtime/pinner_test.go

    		data[i] = new(obj)
    	}
    	b.ResetTimer()
    	for n := 0; n < b.N; n++ {
    		var pinner runtime.Pinner
    		for i := 0; i < Batch; i++ {
    			pinner.Pin(data[i])
    		}
    		pinner.Unpin()
    	}
    }
    
    func BenchmarkPinnerPinUnpinBatchDouble(b *testing.B) {
    	const Batch = 1000
    	var data [Batch]*obj
    	for i := 0; i < Batch; i++ {
    		data[i] = new(obj)
    	}
    	b.ResetTimer()
    	for n := 0; n < b.N; n++ {
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Wed Sep 13 18:36:12 UTC 2023
    - 11K bytes
    - Viewed (0)
  3. src/crypto/cipher/benchmark_test.go

    	b.ReportAllocs()
    	b.SetBytes(int64(len(buf)))
    
    	var key = make([]byte, keySize)
    	var nonce [12]byte
    	var ad [13]byte
    	aes, _ := aes.NewCipher(key[:])
    	aesgcm, _ := cipher.NewGCM(aes)
    	var out []byte
    
    	b.ResetTimer()
    	for i := 0; i < b.N; i++ {
    		out = aesgcm.Seal(out[:0], nonce[:], buf, ad[:])
    	}
    }
    
    func benchmarkAESGCMOpen(b *testing.B, buf []byte, keySize int) {
    	b.ReportAllocs()
    	b.SetBytes(int64(len(buf)))
    
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Wed Apr 28 19:13:50 UTC 2021
    - 3.3K bytes
    - Viewed (0)
  4. pkg/test/loadbalancersim/timer/queue.go

    		resetTimerCh: make(chan struct{}),
    	}
    
    	// Start the worker thread.
    	go func() {
    		for {
    			select {
    			case <-q.stopCh:
    				q.stopTimer()
    				return
    			case <-q.resetTimerCh:
    				q.resetTimer()
    			case <-q.timer.C:
    				q.onTimerExpired()
    			}
    		}
    	}()
    
    	return q
    }
    
    func (q *Queue) Len() int {
    	q.mutex.Lock()
    	defer q.mutex.Unlock()
    	return q.heap.Len()
    }
    
    Registered: Fri Jun 14 15:00:06 UTC 2024
    - Last Modified: Thu Jul 20 19:13:32 UTC 2023
    - 3.6K bytes
    - Viewed (0)
  5. src/cmd/compile/internal/ssa/passbm_test.go

    	CheckFunc(fun.f)
    	b.ResetTimer()
    	for i := 0; i < b.N; i++ {
    		fn(fun.f)
    		b.StopTimer()
    		CheckFunc(fun.f)
    		b.StartTimer()
    	}
    }
    
    // benchFnBlock runs passFunc across a function with b.N blocks.
    func benchFnBlock(b *testing.B, fn passFunc, bg blockGen) {
    	b.ReportAllocs()
    	c := testConfig(b)
    	fun := c.Fun("entry", bg(b.N)...)
    	CheckFunc(fun.f)
    	b.ResetTimer()
    	for i := 0; i < passCount; i++ {
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Tue Mar 26 19:58:28 UTC 2024
    - 3.1K bytes
    - Viewed (0)
  6. cmd/url_test.go

    		b.Fatal(err)
    	}
    
    	// benchmark utility which helps obtain number of allocations and bytes allocated per ops.
    	b.ReportAllocs()
    	// the actual benchmark for PutObject starts here. Reset the benchmark timer.
    	b.ResetTimer()
    
    	if err := req.ParseForm(); err != nil {
    		b.Fatal(err)
    	}
    
    	b.RunParallel(func(pb *testing.PB) {
    		for pb.Next() {
    			req.Form.Get("uploadId")
    		}
    	})
    
    	// Benchmark ends here. Stop timer.
    Registered: Sun Jun 16 00:44:34 UTC 2024
    - Last Modified: Tue Nov 16 17:28:29 UTC 2021
    - 2K bytes
    - Viewed (0)
  7. src/crypto/internal/bigmod/nat_test.go

    	x := makeBenchmarkValue()
    	y := makeBenchmarkValue()
    	m := makeBenchmarkModulus()
    
    	b.ResetTimer()
    	for i := 0; i < b.N; i++ {
    		x.Add(y, m)
    	}
    }
    
    func BenchmarkModSub(b *testing.B) {
    	x := makeBenchmarkValue()
    	y := makeBenchmarkValue()
    	m := makeBenchmarkModulus()
    
    	b.ResetTimer()
    	for i := 0; i < b.N; i++ {
    		x.Sub(y, m)
    	}
    }
    
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Fri Jan 12 00:56:20 UTC 2024
    - 11.6K bytes
    - Viewed (0)
  8. pkg/api/testing/serialization_test.go

    // reflection (to clear APIVersion and Kind)
    func BenchmarkEncodeCodec(b *testing.B) {
    	items := benchmarkItems(b)
    	width := len(items)
    	b.ResetTimer()
    	for i := 0; i < b.N; i++ {
    		if _, err := runtime.Encode(legacyscheme.Codecs.LegacyCodec(v1.SchemeGroupVersion), &items[i%width]); err != nil {
    			b.Fatal(err)
    		}
    	}
    	b.StopTimer()
    }
    
    Registered: Sat Jun 15 01:39:40 UTC 2024
    - Last Modified: Mon Sep 25 11:04:08 UTC 2023
    - 19.3K bytes
    - Viewed (0)
  9. src/unique/handle_bench_test.go

    }
    
    func benchmarkMake(b *testing.B, testData []string) {
    	handles := make([]Handle[string], 0, len(testData))
    	for i := range testData {
    		handles = append(handles, Make(testData[i]))
    	}
    
    	b.ReportAllocs()
    	b.ResetTimer()
    
    	b.RunParallel(func(pb *testing.PB) {
    		i := 0
    		for pb.Next() {
    			_ = Make(testData[i])
    			i++
    			if i >= len(testData) {
    				i = 0
    			}
    		}
    	})
    
    	b.StopTimer()
    
    	runtime.GC()
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Mon Apr 22 18:14:07 UTC 2024
    - 1.1K bytes
    - Viewed (0)
  10. src/internal/fuzz/mutator_test.go

    	m := newMutator()
    
    	for _, size := range []int{
    		1,
    		10,
    		100,
    		1000,
    		10000,
    		100000,
    	} {
    		b.Run(strconv.Itoa(size), func(b *testing.B) {
    			buf := make([]byte, size)
    			b.ResetTimer()
    
    			for i := 0; i < b.N; i++ {
    				// resize buffer to the correct shape and reset the PCG
    				buf = buf[0:size]
    				m.r = newPcgRand()
    				m.mutate([]any{buf}, workerSharedMemSize)
    			}
    		})
    	}
    }
    
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Mon Dec 13 18:45:54 UTC 2021
    - 2.3K bytes
    - Viewed (0)
Back to top