Use an internal Rc inside of TokenStream to make clones cheap.
Lazily fully clone the internal list of tokens if an extend
happens.
Use a simple interning scheme to ensure that Ident and Literal are
also cheaply clone-able.
This overall ensures that every type is cheaply cloneable and should
help reduce extra allocations for types like Ident. Locally the
runtime for the "giant serde benchmark" improved by nearly 40%, dropping
the wasm execution time from 140ms to 80ms.
Use an internal
Rc
inside ofTokenStream
to make clones cheap. Lazily fully clone the internal list of tokens if anextend
happens.Use a simple interning scheme to ensure that
Ident
andLiteral
are also cheaply clone-able.This overall ensures that every type is cheaply cloneable and should help reduce extra allocations for types like
Ident
. Locally the runtime for the "giant serde benchmark" improved by nearly 40%, dropping the wasm execution time from 140ms to 80ms.Closes #20