perf(plugin): `hstr::Atom` has very inefficient serialization/deserialization logic
Currently, it creates a String each time it's serialized, but rkyv supports shared-pointer string serializarion.
https://github.com/swc-project/swc/blob/6c68a1e96b1b0ee7a263be94242937c1eec2a729/crates/hstr/src/lib.rs#L387-L418
cc @quininer
Regarding https://github.com/swc-project/swc/pull/11100 and https://github.com/swc-project/swc/pull/11198, does this still apply after merging those PRs?
i.e. Does the new serilalization format support a shared-pointer string serialization?
No, CBOR doesn't support this; it's just like JSON but in binary format.
If we are to support this, it would look better to use an external string pool and a string ID.
String pool sounds good. I'll keep this PR open. I have implemented one for turbopack, so it's not a hard task for me.