Skip to content

Commit c7405d1

Browse files
committed
Add performance remarks
1 parent 14a38a5 commit c7405d1

2 files changed

Lines changed: 4 additions & 2 deletions

File tree

src/BinaryToText/Base85.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414
using Resources;
1515

1616
/// <summary>Provides functionality for encoding data into the Base-85 (also called Ascii85) text representation and back.</summary>
17+
/// <remarks><b>Performance:</b> Highly optimized. Base85 encodes data in independent 4-byte groups, forming no serial dependency chain between groups. This makes it highly amenable to SIMD vectorization (AVX2) and parallel processing across multiple cores, resulting in throughput that scales with available hardware.</remarks>
1718
public sealed class Base85 : BinaryToTextEncoding
1819
{
1920
private const int ChunkSize = 1024 * 1024;

src/BinaryToText/Base91.cs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,8 @@
88
using Resources;
99

1010
/// <summary>Provides functionality for encoding data into the Base-91 (formerly written basE91) text representation and back.</summary>
11-
/// <remarks>See more: <seealso href="http://base91.sourceforge.net/"/>.</remarks>
11+
/// <remarks><b>Performance:</b> Poor by design. Base91 is inherently sequential — each output word depends on an accumulated bit-state carried over from the previous byte, forming a serial dependency chain. This makes parallel encoding and decoding impossible without a full pre-scan pass that replicates the entire computation, which negates any potential gain from parallelism.</remarks>
12+
/// <seealso href="http://base91.sourceforge.net/"/>
1213
public sealed class Base91 : BinaryToTextEncoding
1314
{
1415
/// ReSharper disable CommentTypo
@@ -135,7 +136,7 @@ public override void DecodeStream(Stream inputStream, Stream outputStream, bool
135136
db[1] = -1;
136137
}
137138
if (db[1] != -1)
138-
bso.WriteByte((byte)((db[2] | (db[1] << db[3])) & byte.MaxValue));
139+
bso.WriteByte((byte)((db[2] | db[1] << db[3]) & byte.MaxValue));
139140
}
140141
finally
141142
{

0 commit comments

Comments
 (0)