serenity/AK
Timothy Flynn 0fd7ad09a0 AK: Avoid StringBuilder when creating a Base64-encoded string
We don't really need the features provided by StringBuilder here, since
we know the exact size of the output. Avoiding StringBuilder avoids the
recurring capacity/size checks both within StringBuilder itself and its
internal ByteBuffer.

This reduces the runtime of `./bin/base64 enwik8 >/dev/null` from
0.976s to 0.428s.

(enwik8 is a 100MB test file from http://mattmahoney.net/dc/enwik8.zip)
2024-03-21 15:53:46 +01:00
..
.clang-tidy
AllOf.h
AnyOf.h
ArbitrarySizedEnum.h
Array.h AK: Add to_array() 2024-02-11 18:53:00 +01:00
Assertions.cpp AK: Disable assertion output colors on windows 2023-10-29 07:40:35 +01:00
Assertions.h Everywhere: Prefer VERIFY over assert() 2024-02-05 07:03:53 -05:00
Atomic.h AK: Fix volatile qualifier in Atomic<T*>::ptr() 2023-08-18 16:20:13 +02:00
AtomicRefCounted.h
Badge.h
Base64.cpp AK: Avoid StringBuilder when creating a Base64-encoded string 2024-03-21 15:53:46 +01:00
Base64.h AK: Add base64url encoding and decoding methods 2024-03-20 12:18:57 -04:00
BigIntBase.h
BinaryBufferWriter.h
BinaryHeap.h AK: Introduce IntrusiveBinaryHeap and reimplement BinaryHeap using it 2024-02-25 17:24:36 -07:00
BinarySearch.h
BitCast.h
Bitmap.h
BitmapView.h AK: Fix one-off error in BitmapView::find_first and find_one_anywhere 2023-10-11 15:58:16 +02:00
BitStream.h AK: Add BigEndianInputBitStream::bits_until_next_byte_boundary() 2024-02-12 14:08:56 +01:00
BufferedStream.h AK: Allow reading from EOF buffered streams better in read_line() 2024-02-26 13:16:27 -07:00
BuiltinWrappers.h AK: Fix doc comment for bit_scan_forward 2023-10-11 14:36:48 -04:00
BumpAllocator.h
ByteBuffer.h AK: Add an option to zero-fill ByteBuffer data upon growth 2023-12-27 19:30:39 +01:00
ByteReader.h
ByteString.cpp AK+LibJS: Remove null state from DeprecatedFlyString :^) 2024-02-24 15:06:52 -07:00
ByteString.h AK+LibJS: Remove null state from DeprecatedFlyString :^) 2024-02-24 15:06:52 -07:00
CharacterTypes.h AK: Add is_ascii_uppercase_hex_digit() 2024-03-01 14:17:42 +01:00
Checked.h AK: Use fallback builtins for overflow checks in AK::Checked 2023-12-21 15:31:32 +01:00
CheckedFormatString.h
CircularBuffer.cpp
CircularBuffer.h
CircularDeque.h
CircularQueue.h
CMakeLists.txt AK+LibURL: Move AK::URL into a new URL library 2024-03-18 14:06:28 -04:00
Complex.h AK: Cover TestComplex with more tests 2024-01-12 16:42:51 -07:00
Concepts.h
ConstrainedStream.cpp
ConstrainedStream.h
CountingStream.cpp
CountingStream.h
COWVector.h AK+LibRegex+LibWasm: Remove the non-const COWVector::operator[] 2024-03-12 17:10:47 +01:00
DateConstants.h
Debug.h.in LibGfx: Add the start of a JBIG2 loader 2024-03-09 16:01:22 +01:00
DefaultDelete.h
Demangle.h Everywhere: Rename {Deprecated => Byte}String 2023-12-17 18:25:10 +03:30
DeprecatedFlyString.cpp AK+LibJS: Remove null state from DeprecatedFlyString :^) 2024-02-24 15:06:52 -07:00
DeprecatedFlyString.h AK+LibJS: Remove null state from DeprecatedFlyString :^) 2024-02-24 15:06:52 -07:00
Diagnostics.h
DisjointChunks.h AK: Rename GenericTraits to DefaultTraits 2023-11-09 10:05:51 -05:00
DistinctNumeric.h AK: Rename GenericTraits to DefaultTraits 2023-11-09 10:05:51 -05:00
DOSPackedTime.cpp
DOSPackedTime.h
DoublyLinkedList.h
Endian.h ntpquery: Use AK::convert_between_host_and_network_endian 2024-02-06 04:37:47 -07:00
EnumBits.h
Error.cpp
Error.h Everywhere: Rename {Deprecated => Byte}String 2023-12-17 18:25:10 +03:30
Find.h AK: Use Iterator's trait when comparing a value 2023-08-23 20:21:09 +02:00
FixedArray.h
FixedPoint.h AK: Make FixedPoint work on platforms without __int128 2023-09-06 07:17:03 -06:00
FixedStringBuffer.h AK+Kernel: Introduce StdLib function to copy FixedStringBuffer to user 2023-08-25 11:51:52 +02:00
FloatingPoint.h AK: Make IndexSequence use size_t 2024-02-11 18:53:00 +01:00
FloatingPointStringConversions.cpp AK: Add a 'HostIsLittleEndian' constant and use it instead of BYTE_ORDER 2023-08-21 13:39:32 +03:30
FloatingPointStringConversions.h
FlyString.cpp AK: Make FlyString-to-FlyString comparison inline & trivial 2024-03-14 12:42:08 +01:00
FlyString.h AK: Make FlyString-to-FlyString comparison inline & trivial 2024-03-14 12:42:08 +01:00
Format.cpp AK: Make the :hex-dump format specifier print all characters 2024-01-21 21:13:58 +01:00
Format.h Everywhere: Rename {Deprecated => Byte}String 2023-12-17 18:25:10 +03:30
Forward.h AK+LibURL: Move AK::URL into a new URL library 2024-03-18 14:06:28 -04:00
FPControl.h AK: Ensure unions with bitfield structs actually have correct sizes 2023-11-01 09:10:38 +03:30
Function.h AK: Use outline Function storage if alignment requirements are not met 2023-09-22 22:10:16 +03:30
FuzzyMatch.cpp AK/FuzzyMatch: Check every match for neighbor character bonuses 2023-10-06 22:09:18 +02:00
FuzzyMatch.h
GenericLexer.cpp AK+LibXML+JSSpecCompiler: Move LineTrackingLexer to AK 2024-02-16 15:26:43 +01:00
GenericLexer.h AK+LibXML+JSSpecCompiler: Move LineTrackingLexer to AK 2024-02-16 15:26:43 +01:00
GenericShorthands.h
HashFunctions.h
HashMap.h AK: Early return from empty hash table lookups to avoid hashing 2024-03-16 14:27:59 +01:00
HashTable.h AK: Early return from empty hash table lookups to avoid hashing 2024-03-16 14:27:59 +01:00
Hex.cpp Everywhere: Rename {Deprecated => Byte}String 2023-12-17 18:25:10 +03:30
Hex.h Everywhere: Rename {Deprecated => Byte}String 2023-12-17 18:25:10 +03:30
IDAllocator.h
InsertionSort.h
IntegralMath.h AK: Use correct type when calculating integral exp2() 2023-10-27 21:59:44 -04:00
IntrusiveDetails.h
IntrusiveList.h
IntrusiveListRelaxedConst.h
IntrusiveRedBlackTree.h
IPv4Address.h Everywhere: Use to_number<T> instead of to_{int,uint,float,double} 2023-12-23 20:41:07 +01:00
IPv6Address.h AK: Rename GenericTraits to DefaultTraits 2023-11-09 10:05:51 -05:00
IterationDecision.h
Iterator.h Everywhere: Rename {Deprecated => Byte}String 2023-12-17 18:25:10 +03:30
JsonArray.h Everywhere: Rename {Deprecated => Byte}String 2023-12-17 18:25:10 +03:30
JsonArraySerializer.h Everywhere: Rename {Deprecated => Byte}String 2023-12-17 18:25:10 +03:30
JsonObject.cpp AK+Everywhere: Remove JsonValue APIs with implicit default values 2024-01-21 15:47:53 -07:00
JsonObject.h AK: Store JsonValue's value in AK::Variant 2024-02-08 08:04:05 -07:00
JsonObjectSerializer.h Everywhere: Rename {Deprecated => Byte}String 2023-12-17 18:25:10 +03:30
JsonParser.cpp AK: Remove ByteString from GenericLexer 2024-01-12 17:03:53 -07:00
JsonParser.h Everywhere: Rename {Deprecated => Byte}String 2023-12-17 18:25:10 +03:30
JsonPath.cpp Everywhere: Rename {Deprecated => Byte}String 2023-12-17 18:25:10 +03:30
JsonPath.h Everywhere: Rename {Deprecated => Byte}String 2023-12-17 18:25:10 +03:30
JsonValue.cpp AK: Store JsonValue's value in AK::Variant 2024-02-08 08:04:05 -07:00
JsonValue.h AK: Store JsonValue's value in AK::Variant 2024-02-08 08:04:05 -07:00
kmalloc.cpp
kmalloc.h
kstdio.h
LEB128.h
LexicalPath.cpp Everywhere: Rename {Deprecated => Byte}String 2023-12-17 18:25:10 +03:30
LexicalPath.h Everywhere: Rename {Deprecated => Byte}String 2023-12-17 18:25:10 +03:30
MACAddress.h Everywhere: Rename {Deprecated => Byte}String 2023-12-17 18:25:10 +03:30
Math.h AK: Remove rsqrt() 2024-01-30 10:02:33 +01:00
MaybeOwned.h AK: Add is_owned() method to MaybeOwned 2023-11-18 19:32:31 +01:00
MemMem.h
Memory.h
MemoryStream.cpp AK: Use an enum to specify the open mode instead of a bool 2023-11-08 18:19:34 +01:00
MemoryStream.h AK: Use an enum to specify the open mode instead of a bool 2023-11-08 18:19:34 +01:00
NeverDestroyed.h
NoAllocationGuard.h
Noncopyable.h AK: Add AK_MAKE_DEFAULT_COPYABLE 2024-01-21 16:16:15 -07:00
NonnullOwnPtr.h AK: Rename GenericTraits to DefaultTraits 2023-11-09 10:05:51 -05:00
NonnullRefPtr.h AK: Rename GenericTraits to DefaultTraits 2023-11-09 10:05:51 -05:00
NumberFormat.cpp AK+Userland: Return String from human_readable_size() functions 2024-01-25 09:07:32 +01:00
NumberFormat.h AK+Userland: Return String from human_readable_size() functions 2024-01-25 09:07:32 +01:00
NumericLimits.h
Optional.h AK+LibJS: Remove OFFSET_OF and its users 2024-02-29 09:00:00 +01:00
OptionParser.cpp AK: Update OptionParser::m_arg_index by substracting skipped args 2024-02-06 00:08:30 +01:00
OptionParser.h
OwnPtr.h AK: Rename GenericTraits to DefaultTraits 2023-11-09 10:05:51 -05:00
Platform.h AK+Lagom: Make it possible to build for iOS 2024-03-03 13:13:42 -07:00
PrintfImplementation.h AK: Implement printf's "period without precision value" correctly 2023-10-06 08:21:18 +02:00
Ptr32.h
Queue.h
QuickSelect.h
QuickSort.h
Random.cpp LibTest: Add more numeric generators 2024-01-12 16:42:51 -07:00
Random.h LibTest: Add more numeric generators 2024-01-12 16:42:51 -07:00
RecursionDecision.h AK: Add missing include in RecursionDecision.h 2023-08-18 08:58:51 +03:30
RedBlackTree.h
RefCounted.h
RefCountForwarder.h
RefPtr.h AK: Rename GenericTraits to DefaultTraits 2023-11-09 10:05:51 -05:00
Result.h
ReverseIterator.h Everywhere: Rename {Deprecated => Byte}String 2023-12-17 18:25:10 +03:30
ScopedValueRollback.h
ScopeGuard.h
ScopeLogger.h Everywhere: Rename {Deprecated => Byte}String 2023-12-17 18:25:10 +03:30
SegmentedVector.h AK+LibWeb: Use segmented vector to store commands in RecordingPainter 2023-12-30 23:02:46 +01:00
SIMD.h
SIMDExtras.h LibWasm: Implement a few SIMD instructions 2023-08-21 13:39:32 +03:30
SIMDMath.h AK: Remove the SIMD version of rsqrt() too, for good measure 2024-01-30 10:02:33 +01:00
Singleton.h
SinglyLinkedList.h AK+Kernel: Unify Traits<T>::equals()'s argument order on different types 2023-08-23 20:21:09 +02:00
SinglyLinkedListSizePolicy.h
SipHash.cpp AK: Make SipHash not depend on size_t bit length 2023-10-27 05:57:18 +03:30
SipHash.h AK: Implement SipHash as the default hash algorithm for most use cases 2023-10-01 11:06:36 +03:30
Slugify.cpp AK: Implement slugify function for URL slug generation 2023-10-30 10:39:59 +00:00
Slugify.h AK: Implement slugify function for URL slug generation 2023-10-30 10:39:59 +00:00
SourceGenerator.h Everywhere: Rename {Deprecated => Byte}String 2023-12-17 18:25:10 +03:30
SourceLocation.h AK: Add copy assignment operator for SourceLocation 2023-09-24 14:55:32 +02:00
Span.h AK: Generalize Span::contains_slow to use the Traits infrastructure 2024-03-16 08:42:33 +01:00
Stack.h
StackInfo.cpp AK+Lagom: Make it possible to build for iOS 2024-03-03 13:13:42 -07:00
StackInfo.h
Statistics.h AK: Allow Statistics to be used with any container type 2023-08-16 01:10:35 +02:00
StdLibExtraDetails.h LibCrypto: Add a minimal DER encoder 2024-03-16 01:17:02 -06:00
StdLibExtras.h AK+LibJS: Remove OFFSET_OF and its users 2024-02-29 09:00:00 +01:00
Stream.cpp
Stream.h
String.cpp AK: Remove StringInternals.h 2024-01-21 16:16:15 -07:00
String.h AK: Store data in FlyString as StringBase 2024-01-21 16:16:15 -07:00
StringBase.cpp AK: Remove StringInternals.h 2024-01-21 16:16:15 -07:00
StringBase.h AK: Make FlyString-to-FlyString comparison inline & trivial 2024-03-14 12:42:08 +01:00
StringBuilder.cpp AK: Implement StringBuilder::append_code_point() more efficiently 2023-12-30 13:49:50 +01:00
StringBuilder.h LibTextCodec+AK: Don't validate UTF-8 strings twice 2023-12-30 13:49:50 +01:00
StringFloatingPointConversions.cpp
StringFloatingPointConversions.h
StringHash.h AK: Implement SipHash as the default hash algorithm for most use cases 2023-10-01 11:06:36 +03:30
StringImpl.cpp AK+Everywhere: Remove the null state of DeprecatedString 2023-10-13 18:33:21 +03:30
StringImpl.h
StringUtils.cpp AK: Improve performance of StringUtils::find_last 2024-01-04 11:28:03 -05:00
StringUtils.h Everywhere: Rename {Deprecated => Byte}String 2023-12-17 18:25:10 +03:30
StringView.cpp AK: Add a StringView method to count the number of lines in a string 2024-03-08 14:43:33 -05:00
StringView.h AK: Add a StringView method to count the number of lines in a string 2024-03-08 14:43:33 -05:00
TemporaryChange.h
Time.cpp
Time.h AK: Define compound subtraction operator for UnixDateTime 2023-11-08 09:28:17 +01:00
Traits.h AK: Provide a default set of Traits for const types 2023-11-09 10:05:51 -05:00
Trie.h
Try.h
Tuple.h AK: Make IndexSequence use size_t 2024-02-11 18:53:00 +01:00
TypeCasts.h
TypedTransfer.h
TypeList.h AK: Make IndexSequence use size_t 2024-02-11 18:53:00 +01:00
Types.h AK: Make IndexSequence use size_t 2024-02-11 18:53:00 +01:00
UBSanitizer.h
UFixedBigInt.h AK: Add shorthands for u384, u768, and u1536 2023-11-11 14:40:10 +03:30
UFixedBigIntDivision.h AK: Fix compile error when using div_mod_internal<513, 256, true> 2023-11-27 09:43:07 +03:30
UnicodeUtils.h AK: Stop using ShortString in String::from_code_point 2024-01-21 16:16:15 -07:00
Userspace.h
Utf8View.cpp AK: Add ASCII fast path to Utf8CodePointIterator 2023-12-30 13:49:50 +01:00
Utf8View.h Everywhere: Rename {Deprecated => Byte}String 2023-12-17 18:25:10 +03:30
Utf16View.cpp AK: Add a Utf16View::starts_with method 2024-01-04 12:43:10 +01:00
Utf16View.h AK: Add a Utf16View::starts_with method 2024-01-04 12:43:10 +01:00
Utf32View.cpp
Utf32View.h
UUID.cpp
UUID.h
Variant.h AK: Make IndexSequence use size_t 2024-02-11 18:53:00 +01:00
Vector.h AK+LibJS: Remove OFFSET_OF and its users 2024-02-29 09:00:00 +01:00
Weakable.h AK+LibJS: Remove OFFSET_OF and its users 2024-02-29 09:00:00 +01:00
WeakPtr.h