Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[refactor] - base64 decoder #3762

Open
wants to merge 6 commits into
base: main
Choose a base branch
from
Open
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
updates benchmarks
  • Loading branch information
ahrav committed Dec 11, 2024
commit 5684d28b21e8c3f89f8837e20458a0902f76a849
15 changes: 15 additions & 0 deletions pkg/decoders/base64_test.go
Original file line number Diff line number Diff line change
@@ -156,6 +156,7 @@ func BenchmarkFromChunkSmall(b *testing.B) {
data := detectors.MustGetBenchmarkData()["small"]

b.ReportAllocs()
b.SetBytes(int64(len(data)))
b.ResetTimer()
for n := 0; n < b.N; n++ {
d.FromChunk(&sources.Chunk{Data: data})
@@ -167,6 +168,7 @@ func BenchmarkFromChunkMedium(b *testing.B) {
data := detectors.MustGetBenchmarkData()["medium"]

b.ReportAllocs()
b.SetBytes(int64(len(data)))
b.ResetTimer()
for n := 0; n < b.N; n++ {
d.FromChunk(&sources.Chunk{Data: data})
@@ -178,6 +180,19 @@ func BenchmarkFromChunkLarge(b *testing.B) {
data := detectors.MustGetBenchmarkData()["large"]

b.ReportAllocs()
b.SetBytes(int64(len(data)))
b.ResetTimer()
for n := 0; n < b.N; n++ {
d.FromChunk(&sources.Chunk{Data: data})
}
}

func BenchmarkFromChunkXLarge(b *testing.B) {
d := Base64{}
data := detectors.MustGetBenchmarkData()["xlarge"]

b.ReportAllocs()
b.SetBytes(int64(len(data)))
b.ResetTimer()
for n := 0; n < b.N; n++ {
d.FromChunk(&sources.Chunk{Data: data})