Skip to content

Commit 9e813e7

Browse files
author
Daniel Lemire
committed
adding results
1 parent c5a9ff3 commit 9e813e7

3 files changed

Lines changed: 27 additions & 17 deletions

File tree

README.md

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ really fast base64 decoding function. The initial work that lead to the fast fun
66
was carried out by [gfoidl](https://github.com/gfoidl/Base64).
77

88
- There are accelerated base64 functions for UTF-8 inputs in the .NET runtime, but they are not optimal:
9-
we can make them 50% to 2x or 3x faster.
9+
we can make them 50% faster.
1010
- There is no accelerated base64 functions for UTF-16 inputs (e.g., `string` types). We can be 2x faster
1111
or more.
1212

@@ -18,6 +18,18 @@ of the presence of allowable white space characters and the need to validate the
1818
inputs are valid for encoding, but only some inputs are valid for decoding. Having to skip white space
1919
characters makes accelerated decoding somewhat difficult.
2020

21+
## Results (SimdBase64 vs. fast .NET functions)
22+
23+
We use the enron base64 data for benchmarking, see benchmark/data/email.
24+
We process the data as UTF-8 (ASCII) using the .NET accelerated functions
25+
as a reference (`System.Buffers.Text.Base64.DecodeFromUtf8`).
26+
27+
28+
| processor | SimdBase64(GB/s) | .NET speed (GB/s) | speed up |
29+
|:----------------|:------------------------|:-------------------|:-------------------|
30+
| Apple M2 processor (ARM) | 6.2 | 3.8 | 1.6 x |
31+
| Intel Ice Lake (AVX2) | 5.3 | 3.4 | 1.6 x |
32+
2133

2234
## Requirements
2335

benchmark/Benchmark.cs

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -153,8 +153,8 @@ public Config()
153153
}
154154
// Parameters and variables for real data
155155
[Params(
156-
@"data/email/",
157-
@"data/dns/swedenzonebase.txt"
156+
@"data/email/" //,
157+
//@"data/dns/swedenzonebase.txt"
158158
)]
159159
#pragma warning disable CA1051
160160
public string? FileName;
@@ -552,8 +552,8 @@ public unsafe void DotnetRuntimeSIMDBase64RealDataWithAllocUTF8()
552552
RunRuntimeSIMDDecodingBenchmarkWithAllocUTF8(FileContent, DecodedLengths);
553553
}
554554

555-
[Benchmark]
556-
[BenchmarkCategory("default", "runtime")]
555+
//[Benchmark]
556+
//[BenchmarkCategory("default", "runtime")]
557557
public unsafe void DotnetRuntimeBase64RealDataUTF16()
558558
{
559559
RunRuntimeDecodingBenchmarkUTF16(FileContent, DecodedLengths);
@@ -602,36 +602,36 @@ public unsafe void ARMDecodingRealDataWithAllocUTF8()
602602
RunARMDecodingBenchmarkWithAllocUTF8(FileContent, DecodedLengths);
603603
}
604604

605-
[Benchmark]
606-
[BenchmarkCategory("arm64")]
605+
//[Benchmark]
606+
//[BenchmarkCategory("arm64")]
607607
public unsafe void ARMDecodingRealDataUTF16()
608608
{
609609
RunARMDecodingBenchmarkUTF16(FileContent, DecodedLengths);
610610
}
611611

612-
[Benchmark]
613-
[BenchmarkCategory("SSE")]
612+
//[Benchmark]
613+
//[BenchmarkCategory("SSE")]
614614
public unsafe void SSEDecodingRealDataUTF16()
615615
{
616616
RunSSEDecodingBenchmarkUTF16(FileContent, DecodedLengths);
617617
}
618618

619-
[Benchmark]
620-
[BenchmarkCategory("SSE")]
619+
//[Benchmark]
620+
//[BenchmarkCategory("SSE")]
621621
public unsafe void SSEDecodingRealDataWithAllocUTF16()
622622
{
623623
RunSSEDecodingBenchmarkWithAllocUTF16(FileContent, DecodedLengths);
624624
}
625625

626-
[Benchmark]
627-
[BenchmarkCategory("AVX")]
626+
//[Benchmark]
627+
//[BenchmarkCategory("AVX")]
628628
public unsafe void AVX2DecodingRealDataUTF16()
629629
{
630630
RunAVX2DecodingBenchmarkUTF16(FileContent, DecodedLengths);
631631
}
632632

633-
[Benchmark]
634-
[BenchmarkCategory("AVX")]
633+
//[Benchmark]
634+
//[BenchmarkCategory("AVX")]
635635
public unsafe void AVX2DecodingRealDataWithAllocUTF16()
636636
{
637637
RunAVX2DecodingBenchmarkWithAllocUTF16(FileContent, DecodedLengths);

benchmark/benchmark.csproj

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,4 @@
3030
</None>
3131
</ItemGroup>
3232

33-
34-
3533
</Project>

0 commit comments

Comments
 (0)