Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 1 of 1 for BenchmarkFindSubmatch (0.13 sec)

  1. src/regexp/all_test.go

    	b.ReportAllocs()
    	for i := 0; i < b.N; i++ {
    		subs := re.FindString(s)
    		if subs != wantSubs {
    			b.Fatalf("FindString(%q) = %q; want %q", s, subs, wantSubs)
    		}
    	}
    }
    
    func BenchmarkFindSubmatch(b *testing.B) {
    	b.StopTimer()
    	re := MustCompile("a(a+b+)b")
    	wantSubs := "aaabb"
    	s := []byte("acbb" + wantSubs + "dd")
    	b.StartTimer()
    	b.ReportAllocs()
    	for i := 0; i < b.N; i++ {
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Mon Mar 25 19:36:03 UTC 2024
    - 25.8K bytes
    - Viewed (0)
Back to top