mirror of
https://github.com/fergalmoran/ladybird.git
synced 2026-01-07 00:56:14 +00:00
This patch moves the data members of URL to an internal URL::Data struct that is also reference-counted. URL then uses a CopyOnWrite<T> template to give itself copy-on-write behavior. This means that URL itself is now 8 bytes per instance, and copying is cheap as long as you don't mutate. This shrinks many data structures over in LibWeb land. As an example, CSS::ComputedValues goes from 3024 bytes to 2288 bytes per instance.