If the data represented in the Arc is supposed to be immutable, why not pass around a reference of Vec<T>
instead of cloning the Arc<[T]>
over and over? The latter appears more expensive. Arc<String>
is always going to be worse than Arc<str>
because Arc<String>
is roughly equivalent to Arc<Vec<char>>
. Lastly, instead of the overhead of a tuple struct, we could define
pub type MonsterId = Arc<str>;
and maybe define and implement traits on it for additional methods.