summaryrefslogtreecommitdiff
path: root/libgo/go/encoding/base64/base64_test.go
diff options
context:
space:
mode:
Diffstat (limited to 'libgo/go/encoding/base64/base64_test.go')
-rw-r--r--libgo/go/encoding/base64/base64_test.go16
1 files changed, 16 insertions, 0 deletions
diff --git a/libgo/go/encoding/base64/base64_test.go b/libgo/go/encoding/base64/base64_test.go
index a075194e03e..7d199bfa089 100644
--- a/libgo/go/encoding/base64/base64_test.go
+++ b/libgo/go/encoding/base64/base64_test.go
@@ -342,3 +342,19 @@ func TestDecoderIssue7733(t *testing.T) {
t.Errorf("DecodeString = %q; want abcd", s)
}
}
+
+func BenchmarkEncodeToString(b *testing.B) {
+ data := make([]byte, 8192)
+ b.SetBytes(int64(len(data)))
+ for i := 0; i < b.N; i++ {
+ StdEncoding.EncodeToString(data)
+ }
+}
+
+func BenchmarkDecodeString(b *testing.B) {
+ data := StdEncoding.EncodeToString(make([]byte, 8192))
+ b.SetBytes(int64(len(data)))
+ for i := 0; i < b.N; i++ {
+ StdEncoding.DecodeString(data)
+ }
+}