$54 GRAYBYTE WORDPRESS FILE MANAGER $41

SERVER : in-mum-web1330.main-hosting.eu #1 SMP Mon Feb 10 22:45:17 UTC 2025
SERVER IP : 93.127.173.238 | ADMIN IP 216.73.216.215
OPTIONS : CRL = ON | WGT = ON | SDO = OFF | PKEX = OFF
DEACTIVATED : NONE

/opt/go/pkg/mod/google.golang.org/protobuf@v1.30.0/internal/encoding/json/

HOME
Current File : /opt/go/pkg/mod/google.golang.org/protobuf@v1.30.0/internal/encoding/json//bench_test.go
// Copyright 2019 The Go Authors. All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.

package json_test

import (
	"testing"

	"google.golang.org/protobuf/internal/encoding/json"
)

func BenchmarkFloat(b *testing.B) {
	input := []byte(`1.797693134862315708145274237317043567981e+308`)
	for i := 0; i < b.N; i++ {
		dec := json.NewDecoder(input)
		val, err := dec.Read()
		if err != nil {
			b.Fatal(err)
		}
		if _, ok := val.Float(64); !ok {
			b.Fatal("not a float")
		}
	}
}

func BenchmarkInt(b *testing.B) {
	input := []byte(`922337203.6854775807e+10`)
	for i := 0; i < b.N; i++ {
		dec := json.NewDecoder(input)
		val, err := dec.Read()
		if err != nil {
			b.Fatal(err)
		}
		if _, ok := val.Int(64); !ok {
			b.Fatal("not an int64")
		}
	}
}

func BenchmarkString(b *testing.B) {
	input := []byte(`"abcdefghijklmnopqrstuvwxyz0123456789\\n\\t"`)
	for i := 0; i < b.N; i++ {
		dec := json.NewDecoder(input)
		val, err := dec.Read()
		if err != nil {
			b.Fatal(err)
		}
		_ = val.ParsedString()
	}
}

func BenchmarkBool(b *testing.B) {
	input := []byte(`true`)
	for i := 0; i < b.N; i++ {
		dec := json.NewDecoder(input)
		val, err := dec.Read()
		if err != nil {
			b.Fatal(err)
		}
		_ = val.Bool()
	}
}

Current_dir [ NOT WRITEABLE ] Document_root [ WRITEABLE ]


[ Back ]
NAME
SIZE
LAST TOUCH
USER
CAN-I?
FUNCTIONS
..
--
25 Jan 2024 4.43 PM
root / root
0555
bench_test.go
1.256 KB
25 Jan 2024 4.43 PM
root / root
0444
decode.go
8.613 KB
25 Jan 2024 4.43 PM
root / root
0444
decode_number.go
5.166 KB
25 Jan 2024 4.43 PM
root / root
0444
decode_string.go
2.595 KB
25 Jan 2024 4.43 PM
root / root
0444
decode_test.go
24.859 KB
25 Jan 2024 4.43 PM
root / root
0444
decode_token.go
4.399 KB
25 Jan 2024 4.43 PM
root / root
0444
encode.go
7.087 KB
25 Jan 2024 4.43 PM
root / root
0444
encode_test.go
7.396 KB
25 Jan 2024 4.43 PM
root / root
0444

GRAYBYTE WORDPRESS FILE MANAGER @ 2026 CONTACT ME
Static GIF