Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 10 of 32 for doBench (0.12 sec)

  1. src/compress/flate/reader_test.go

    	{"Digits", "../testdata/e.txt"},
    	// Newton is Isaac Newtons's educational text on Opticks.
    	{"Newton", "../../testdata/Isaac.Newton-Opticks.txt"},
    }
    
    func BenchmarkDecode(b *testing.B) {
    	doBench(b, func(b *testing.B, buf0 []byte, level, n int) {
    		b.ReportAllocs()
    		b.StopTimer()
    		b.SetBytes(int64(n))
    
    		compressed := new(bytes.Buffer)
    		w, err := NewWriter(compressed, level)
    		if err != nil {
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Wed Dec 09 19:12:23 UTC 2020
    - 2.3K bytes
    - Viewed (0)
  2. test/fibo.go

    	fmt.Printf("fibo(%d) = %s (%d bits, %s)\n", n, f, f.bitlen(), t)
    }
    
    func benchFibo(b *testing.B, n int, half, opt bool) {
    	for i := 0; i < b.N; i++ {
    		fibo(n, half, opt)
    	}
    }
    
    func doBench(half, opt bool) {
    	w := tabwriter.NewWriter(os.Stdout, 0, 8, 2, ' ', tabwriter.AlignRight)
    	fmt.Fprintf(w, "wordsize = %d, half = %v, opt = %v\n", W, half, opt)
    	fmt.Fprintf(w, "n\talloc count\talloc bytes\tns/op\ttime/op\t\n")
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Mon Dec 08 22:22:58 UTC 2014
    - 6.3K bytes
    - Viewed (0)
  3. src/testing/benchmark.go

    			fmt.Fprintf(b.w, "cpu: %s\n", cpu)
    		}
    	})
    	if b.context != nil {
    		// Running go test --test.bench
    		b.context.processBench(b) // Must call doBench.
    	} else {
    		// Running func Benchmark.
    		b.doBench()
    	}
    }
    
    func (b *B) doBench() BenchmarkResult {
    	go b.launch()
    	<-b.signal
    	return b.result
    }
    
    // launch launches the benchmark function. It gradually increases the number
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu May 23 01:00:11 UTC 2024
    - 23.9K bytes
    - Viewed (0)
  4. src/compress/flate/writer_test.go

    // license that can be found in the LICENSE file.
    
    package flate
    
    import (
    	"bytes"
    	"fmt"
    	"io"
    	"math/rand"
    	"runtime"
    	"testing"
    )
    
    func BenchmarkEncode(b *testing.B) {
    	doBench(b, func(b *testing.B, buf0 []byte, level, n int) {
    		b.StopTimer()
    		b.SetBytes(int64(n))
    
    		buf1 := make([]byte, n)
    		for i := 0; i < n; i += len(buf0) {
    			if len(buf0) > n-i {
    				buf0 = buf0[:n-i]
    			}
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Tue Oct 20 18:41:18 UTC 2020
    - 5.4K bytes
    - Viewed (0)
  5. internal/pubsub/pubsub_test.go

    	ch2 := make(chan Maskable, 1)
    	ch3 := make(chan Maskable, 1)
    	doneCh := make(chan struct{})
    	defer close(doneCh)
    	if err := ps.Subscribe(MaskAll, ch1, doneCh, nil); err != nil {
    		t.Fatalf("unexpected error: %v", err)
    	}
    	if err := ps.Subscribe(MaskAll, ch2, doneCh, nil); err != nil {
    		t.Fatalf("unexpected error: %v", err)
    	}
    	if err := ps.Subscribe(MaskAll, ch3, doneCh, nil); err == nil {
    		t.Fatalf("unexpected nil err")
    	}
    }
    
    Registered: Sun Jun 16 00:44:34 UTC 2024
    - Last Modified: Thu Jan 18 07:03:17 UTC 2024
    - 5.8K bytes
    - Viewed (0)
  6. internal/store/store.go

    					// Get next key.
    					case <-doneCh:
    						return
    					}
    				}
    			}
    
    			select {
    			case <-retryTicker.C:
    			case <-doneCh:
    				return
    			}
    		}
    	}()
    
    	return keyCh
    }
    
    // sendItems - Reads items from the store and re-plays.
    func sendItems(target Target, keyCh <-chan Key, doneCh <-chan struct{}, logger logger) {
    	retryTicker := time.NewTicker(retryInterval)
    Registered: Sun Jun 16 00:44:34 UTC 2024
    - Last Modified: Mon Mar 25 16:44:20 UTC 2024
    - 3.5K bytes
    - Viewed (0)
  7. staging/src/k8s.io/apiserver/pkg/util/flowcontrol/fairqueuing/testing/promise/counting.go

    // - an optional initial value,
    // - an optional "done" channel,
    // - the value that is Set after the "done" channel becomes selectable.
    // Note that for this implementation, the reaction to `doneCh`
    // becoming selectable does not wait for a Get.
    // If `doneCh != nil` then the caller promises to close it reasonably promptly
    // (to the degree allowed by the Go runtime scheduler), and increment the
    // goroutine counter before that.
    Registered: Sat Jun 15 01:39:40 UTC 2024
    - Last Modified: Tue Aug 10 14:37:53 UTC 2021
    - 3.3K bytes
    - Viewed (0)
  8. staging/src/k8s.io/apiserver/pkg/server/healthz_test.go

    	t.Run("test that liveness check returns true until the delay has elapsed", func(t *testing.T) {
    		t0 := time.Unix(0, 0)
    		c := testingclock.NewFakeClock(t0)
    		doneCh := make(chan struct{})
    
    		healthCheck := delayedHealthCheck(postStartHookHealthz{"test", doneCh}, c, time.Duration(10)*time.Second)
    		err := healthCheck.Check(nil)
    		if err != nil {
    			t.Errorf("Got %v, expected no error", err)
    		}
    		c.Step(10 * time.Second)
    Registered: Sat Jun 15 01:39:40 UTC 2024
    - Last Modified: Wed Sep 15 09:52:18 UTC 2021
    - 2.2K bytes
    - Viewed (0)
  9. internal/pubsub/pubsub.go

    		enc := json.NewEncoder(&buf)
    		for {
    			select {
    			case <-doneCh:
    				return
    			case v, ok := <-subChT:
    				if !ok {
    					return
    				}
    				buf.Reset()
    				err := enc.Encode(v)
    				if err != nil {
    					return
    				}
    
    				select {
    				case subCh <- append(GetByteBuffer()[:0], buf.Bytes()...):
    					continue
    				case <-doneCh:
    					return
    				}
    			}
    		}
    	}()
    
    Registered: Sun Jun 16 00:44:34 UTC 2024
    - Last Modified: Tue Feb 06 16:57:30 UTC 2024
    - 5.2K bytes
    - Viewed (0)
  10. platforms/documentation/docs/src/snippets/native-binaries/tool-chains/groovy/build.gradle

                eachPlatform {
                    cppCompiler.withArguments { args ->
                        args << "-DFRENCH"
                    }
                }
            }
            clang(Clang) {
                eachPlatform {
                    cCompiler.withArguments { args ->
                        Collections.replaceAll(args, "CUSTOM", "-DFRENCH")
                    }
                    linker.withArguments { args ->
                        args.remove "CUSTOM"
    Registered: Wed Jun 12 18:38:38 UTC 2024
    - Last Modified: Mon Nov 27 17:53:42 UTC 2023
    - 1.4K bytes
    - Viewed (0)
Back to top