serenity icon indicating copy to clipboard operation
serenity copied to clipboard

AK: Store JsonValue's value in AK::Variant

Open DanShaders opened this issue 1 year ago • 2 comments

As usual, more readable modern code, less unreadable C-style code, and less code in total!

The end goal of my AK refactoring PRs is to share memory layout of ByteString and String using now-merged (hooray!) StringBase. This patchset, in particular, removes the last remaining non-trivial user of StringImpl that complicated the process.

DanShaders avatar Jan 22 '24 00:01 DanShaders

What's the advantage of String and ByteString having the same memory layout?

nico avatar Jan 22 '24 01:01 nico

By memory layout I meant things like allocations and SSO. So the main advantage is code deduplication.

The other argument I had is the potential LibWeb speed up because of cheaper String <-> ByteString conversions, but it looks as if Shannon got rid of a lot of them already.

DanShaders avatar Jan 22 '24 01:01 DanShaders