summaryrefslogtreecommitdiff
path: root/Userland/Utilities/cal.cpp
diff options
context:
space:
mode:
authorAndreas Kling <kling@serenityos.org>2021-04-17 01:18:39 +0200
committerAndreas Kling <kling@serenityos.org>2021-04-17 01:27:31 +0200
commit873da38d0e619ecea1e7956696aac8ac7013540d (patch)
treeb1b5c0bc379218827e31b80fed352a77d67bc3a0 /Userland/Utilities/cal.cpp
parent94b247c5a945860b359f63b7fea172328e6181cf (diff)
downloadserenity-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/cal.cpp')
0 files changed, 0 insertions, 0 deletions