diff options
author | Andreas Kling <kling@serenityos.org> | 2021-04-17 01:18:39 +0200 |
---|---|---|
committer | Andreas Kling <kling@serenityos.org> | 2021-04-17 01:27:31 +0200 |
commit | 873da38d0e619ecea1e7956696aac8ac7013540d (patch) | |
tree | b1b5c0bc379218827e31b80fed352a77d67bc3a0 /Userland/Utilities/base64.cpp | |
parent | 94b247c5a945860b359f63b7fea172328e6181cf (diff) | |
download | serenity-873da38d0e619ecea1e7956696aac8ac7013540d.zip |
AK: Remove String-from-StringView optimization
We had an unusual optimization in AK::StringView where constructing
a StringView from a String would cause it to remember the internal
StringImpl pointer of the String.
This was used to make constructing a String from a StringView fast
and copy-free.
I tried removing this optimization and indeed we started seeing a
ton of allocation traffic. However, all of it was due to a silly
pattern where functions would take a StringView and then go on
to create a String from it.
I've gone through most of the code and updated those functions to
simply take a String directly instead, which now makes this
optimization unnecessary, and indeed a source of bloat instead.
So, let's get rid of it and make StringView a little smaller. :^)
Diffstat (limited to 'Userland/Utilities/base64.cpp')
0 files changed, 0 insertions, 0 deletions