- Sort Score
- Result 10 results
- Languages All
Results 51 - 60 of 65 for GetBytes (0.28 sec)
-
src/strings/strings_test.go
benchStr := Repeat(benchmarkString, (indexSizes[len(indexSizes)-1]+len(benchmarkString)-1)/len(benchmarkString)) benchFunc := func(b *testing.B, benchStr string) { b.SetBytes(int64(len(benchStr))) for i := 0; i < b.N; i++ { Count(benchStr, "=") } } for _, size := range indexSizes { b.Run(fmt.Sprintf("%d", size), func(b *testing.B) {
Registered: Wed Jun 12 16:32:35 UTC 2024 - Last Modified: Fri May 03 12:58:37 UTC 2024 - 53K bytes - Viewed (0) -
src/hash/crc32/crc32_test.go
benchmark(b, h, int64(size), int64(align)) }) } }) } } } func benchmark(b *testing.B, h hash.Hash32, n, alignment int64) { b.SetBytes(n) data := make([]byte, n+alignment) data = data[alignment:] for i := range data { data[i] = byte(i) } in := make([]byte, 0, h.Size()) // Warm up h.Reset() h.Write(data)
Registered: Wed Jun 12 16:32:35 UTC 2024 - Last Modified: Mon Jun 03 14:56:25 UTC 2024 - 12.1K bytes - Viewed (0) -
src/net/sendfile_test.go
defer server.Close() cleanUp, err := startTestSocketPeer(b, client, "r", bench.chunkSize, fileSize) if err != nil { client.Close() b.Fatal(err) } defer cleanUp(b) b.ReportAllocs() b.SetBytes(int64(bench.chunkSize)) b.ResetTimer() // Data go from file to socket via sendfile(2). sent, err := io.Copy(server, f) if err != nil { b.Fatalf("failed to copy data with sendfile, error: %v", err) }
Registered: Wed Jun 12 16:32:35 UTC 2024 - Last Modified: Fri Apr 26 18:12:56 UTC 2024 - 12.1K bytes - Viewed (0) -
src/crypto/x509/name_constraints_test.go
var serialBytes [16]byte rand.Read(serialBytes[:]) template := &Certificate{ SerialNumber: new(big.Int).SetBytes(serialBytes[:]), Subject: pkix.Name{ CommonName: name, }, NotBefore: time.Unix(1000, 0), NotAfter: time.Unix(2000, 0), KeyUsage: KeyUsageCertSign,
Registered: Wed Jun 12 16:32:35 UTC 2024 - Last Modified: Thu May 09 22:40:21 UTC 2024 - 45.2K bytes - Viewed (0) -
src/net/http/request_test.go
--MyBoundary-- ` func benchmarkReadRequest(b *testing.B, request string) { request = request + "\n" // final \n request = strings.ReplaceAll(request, "\n", "\r\n") // expand \n to \r\n b.SetBytes(int64(len(request))) r := bufio.NewReader(&infiniteReader{buf: []byte(request)}) b.ReportAllocs() b.ResetTimer() for i := 0; i < b.N; i++ { _, err := ReadRequest(r) if err != nil {
Registered: Wed Jun 12 16:32:35 UTC 2024 - Last Modified: Thu May 16 18:42:34 UTC 2024 - 44K bytes - Viewed (0) -
src/image/jpeg/reader_test.go
data, err := os.ReadFile(filename) if err != nil { b.Fatal(err) } cfg, err := DecodeConfig(bytes.NewReader(data)) if err != nil { b.Fatal(err) } b.SetBytes(int64(cfg.Width * cfg.Height * 4)) b.ReportAllocs() b.ResetTimer() for i := 0; i < b.N; i++ { Decode(bytes.NewReader(data)) } } func BenchmarkDecodeBaseline(b *testing.B) {
Registered: Wed Jun 12 16:32:35 UTC 2024 - Last Modified: Thu Apr 25 00:46:29 UTC 2024 - 24.4K bytes - Viewed (0) -
src/go/internal/gcimporter/iimport.go
v := -n if signed { v = -(n &^ 1) >> 1 } if v < 1 || uint(v) > maxBytes { errorf("weird decoding: %v, %v => %v", n, signed, v) } b := make([]byte, v) io.ReadFull(&r.declReader, b) x.SetBytes(b) if signed && n&1 != 0 { x.Neg(x) } } func (r *importReader) mpfloat(typ *types.Basic) constant.Value { var mant big.Int r.mpint(&mant, typ) var f big.Float f.SetInt(&mant)
Registered: Wed Jun 12 16:32:35 UTC 2024 - Last Modified: Thu May 23 01:00:11 UTC 2024 - 19.2K bytes - Viewed (0) -
src/math/big/nat.go
func bigEndianWord(buf []byte) Word { if _W == 64 { return Word(byteorder.BeUint64(buf)) } return Word(byteorder.BeUint32(buf)) } // setBytes interprets buf as the bytes of a big-endian unsigned // integer, sets z to that value, and returns z. func (z nat) setBytes(buf []byte) nat { z = z.make((len(buf) + _S - 1) / _S) i := len(buf) for k := 0; i >= _S; k++ { z[k] = bigEndianWord(buf[i-_S : i])
Registered: Wed Jun 12 16:32:35 UTC 2024 - Last Modified: Mon May 13 21:31:58 UTC 2024 - 31.7K bytes - Viewed (0) -
src/runtime/hash_test.go
for i := range b { b[i] = byte(r.Uint32()) } } func benchmarkHash(b *testing.B, n int) { s := strings.Repeat("A", n) for i := 0; i < b.N; i++ { StringHash(s, 0) } b.SetBytes(int64(n)) } func BenchmarkHash5(b *testing.B) { benchmarkHash(b, 5) } func BenchmarkHash16(b *testing.B) { benchmarkHash(b, 16) } func BenchmarkHash64(b *testing.B) { benchmarkHash(b, 64) }
Registered: Wed Jun 12 16:32:35 UTC 2024 - Last Modified: Mon May 06 17:50:18 UTC 2024 - 18.4K bytes - Viewed (0) -
src/crypto/x509/x509_test.go
Subject: pkix.Name{CommonName: "Cert"}, NotBefore: time.Unix(1000, 0), NotAfter: time.Unix(100000, 0), } for _, serial := range []*big.Int{ big.NewInt(0).SetBytes(bytes.Repeat([]byte{5}, 21)), big.NewInt(0).SetBytes(bytes.Repeat([]byte{255}, 20)), } { template.SerialNumber = serial certDER, err := CreateCertificate(rand.Reader, &template, &template, rsaPrivateKey.Public(), rsaPrivateKey)
Registered: Wed Jun 12 16:32:35 UTC 2024 - Last Modified: Wed May 22 21:00:16 UTC 2024 - 163.4K bytes - Viewed (0)