Search Options

Results per page
Sort
Preferred Languages
Advance

Results 41 - 50 of 2,047 for Mallocs (0.18 sec)

  1. src/sync/oncefunc_test.go

    	calls := 0
    	f := sync.OnceFunc(func() { calls++ })
    	allocs := testing.AllocsPerRun(10, f)
    	if calls != 1 {
    		t.Errorf("want calls==1, got %d", calls)
    	}
    	if allocs != 0 {
    		t.Errorf("want 0 allocations per call, got %v", allocs)
    	}
    }
    
    func TestOnceValue(t *testing.T) {
    	calls := 0
    	f := sync.OnceValue(func() int {
    		calls++
    		return calls
    	})
    	allocs := testing.AllocsPerRun(10, func() { f() })
    	value := f()
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Tue Nov 21 17:31:33 UTC 2023
    - 6.9K bytes
    - Viewed (0)
  2. src/crypto/internal/nistec/nistec_test.go

    				t.Fatal(err)
    			}
    			out = p.BytesCompressed()
    			if _, err := p.SetBytes(out); err != nil {
    				t.Fatal(err)
    			}
    		}); allocs > 0 {
    			t.Errorf("expected zero allocations, got %0.1f", allocs)
    		}
    	})
    	t.Run("P256", func(t *testing.T) {
    		if allocs := testing.AllocsPerRun(10, func() {
    			p := nistec.NewP256Point().SetGenerator()
    			scalar := make([]byte, 32)
    			rand.Read(scalar)
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Mon Jun 12 18:48:23 UTC 2023
    - 8.4K bytes
    - Viewed (0)
  3. src/strings/builder_test.go

    		}
    	})
    }
    
    func TestBuilderGrowSizeclasses(t *testing.T) {
    	s := Repeat("a", 19)
    	allocs := testing.AllocsPerRun(100, func() {
    		var b Builder
    		b.Grow(18)
    		b.WriteString(s)
    		_ = b.String()
    	})
    	if allocs > 1 {
    		t.Fatalf("unexpected amount of allocations: %v, want: 1", allocs)
    	}
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Mon Feb 19 19:51:15 UTC 2024
    - 8.1K bytes
    - Viewed (0)
  4. staging/src/k8s.io/apiserver/pkg/util/flowcontrol/conc_alloc.go

    // computeConcurrencyAllocation returns the unique `allocs []float64`, and
    // an associated `fairProp float64`, that jointly have
    // all of the following properties (to the degree that floating point calculations allow)
    // if possible otherwise returns an error saying why it is impossible.
    // `allocs` sums to `requiredSum`.
    // For each J in [0, len(classes)):
    //  1. `classes[J].lowerBound <= allocs[J] <= classes[J].upperBound` and
    Registered: Sat Jun 15 01:39:40 UTC 2024
    - Last Modified: Sun Dec 18 04:27:38 UTC 2022
    - 9.5K bytes
    - Viewed (0)
  5. pkg/controller/nodeipam/ipam/cidrset/cidr_set_test.go

    		}
    		em := testMetrics{
    			usage:      float64(i) / float64(256),
    			allocs:     float64(i),
    			releases:   0,
    			allocTries: 0,
    			max:        float64(max),
    		}
    		expectMetrics(t, cidr, em)
    	}
    	// Release all
    	a.Release(clusterCIDR)
    	em = testMetrics{
    		usage:      0,
    		allocs:     256,
    		releases:   256,
    		allocTries: 0,
    		max:        float64(max),
    	}
    Registered: Sat Jun 15 01:39:40 UTC 2024
    - Last Modified: Thu May 11 08:53:03 UTC 2023
    - 29.5K bytes
    - Viewed (0)
  6. fess-crawler/src/test/java/org/codelibs/fess/crawler/helper/RobotsTxtHelperTest.java

            assertTrue(robotsTxt.allows("/ccc", "Crawler"));
            assertTrue(robotsTxt.allows("/ddd", "Crawler"));
            assertTrue(robotsTxt.allows("/aaa", "Crawler/1.0"));
            assertFalse(robotsTxt.allows("/bbb", "Crawler/1.0"));
            assertTrue(robotsTxt.allows("/ccc", "Crawler/1.0"));
            assertTrue(robotsTxt.allows("/ddd", "Crawler/1.0"));
    Registered: Wed Jun 12 15:17:51 UTC 2024
    - Last Modified: Thu Feb 22 01:36:27 UTC 2024
    - 5.9K bytes
    - Viewed (0)
  7. src/cmd/compile/internal/base/base.go

    	const (
    		goal   = "/gc/heap/goal:bytes"
    		count  = "/gc/cycles/total:gc-cycles"
    		allocs = "/gc/heap/allocs:bytes"
    		frees  = "/gc/heap/frees:bytes"
    	)
    
    	sample := []metrics.Sample{{Name: goal}, {Name: count}, {Name: allocs}, {Name: frees}}
    	const (
    		GOAL   = 0
    		COUNT  = 1
    		ALLOCS = 2
    		FREES  = 3
    	)
    
    	// Assumptions and observations of Go's garbage collector, as of Go 1.17-1.20:
    
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Tue Aug 22 19:18:34 UTC 2023
    - 8K bytes
    - Viewed (0)
  8. src/sync/map_test.go

    }
    
    func TestMapRangeNoAllocations(t *testing.T) { // Issue 62404
    	testenv.SkipIfOptimizationOff(t)
    	var m sync.Map
    	allocs := testing.AllocsPerRun(10, func() {
    		m.Range(func(key, value any) bool {
    			return true
    		})
    	})
    	if allocs > 0 {
    		t.Errorf("AllocsPerRun of m.Range = %v; want 0", allocs)
    	}
    }
    
    // TestConcurrentClear tests concurrent behavior of sync.Map properties to ensure no data races.
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu Feb 01 15:34:22 UTC 2024
    - 8.1K bytes
    - Viewed (0)
  9. src/cmd/go/help_test.go

    		t.Fatalf("%v: %v\n%s", cmd, err, cmd.Stderr)
    	}
    
    	alldocs, err := format.Source(out)
    	if err != nil {
    		t.Fatalf("format.Source($(%v)): %v", cmd, err)
    	}
    
    	const srcPath = `alldocs.go`
    	old, err := os.ReadFile(srcPath)
    	if err != nil {
    		t.Fatalf("error reading %s: %v", srcPath, err)
    	}
    	diff := diff.Diff(srcPath, old, "go help documentation | gofmt", alldocs)
    	if diff == nil {
    		t.Logf("%s is up to date.", srcPath)
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Tue Feb 28 15:45:49 UTC 2023
    - 1.6K bytes
    - Viewed (0)
  10. staging/src/k8s.io/apiserver/pkg/storage/value/encrypt/envelope/kmsv2/cache_test.go

    		var wg sync.WaitGroup
    		for i := 0; i < 100; i++ {
    			wg.Add(1)
    			go func() {
    				f()
    				wg.Done()
    			}()
    		}
    		wg.Wait()
    
    		allocs := testing.AllocsPerRun(100, f)
    		if allocs > 1 {
    			t.Errorf("Expected 1 allocations, got %v", allocs)
    		}
    	})
    }
    
    func TestSimpleCache(t *testing.T) {
    	fakeClock := testingclock.NewFakeClock(time.Now())
    Registered: Sat Jun 15 01:39:40 UTC 2024
    - Last Modified: Thu Aug 31 20:26:58 UTC 2023
    - 4.9K bytes
    - Viewed (0)
Back to top