internal/marshal: marshal is extremely inefficient #38
The code from
To fix this we should either:
If we do option 2, it should be developed in
Other suggestions for how this could be improved are also welcome.
Remove the following line from the docs when fixed:
The text was updated successfully, but these errors were encountered:
Previously if we wanted to encode an arbitrary type to a token writer we were forced to encode it to a byte buffer then decode that buffer and copy it to the writer. This was extremely inefficient. To help us fix this for at least the types in this module, short circuit if the type is any of the various interfaces that can be copied directly to the writer and use their methods for doing so. This patch handles short circuiting on xml.TokenReader, xmlstream.Marshaler, and xmlstream.WriterTo. See #38 Fixes #73 Signed-off-by: Sam Whited <firstname.lastname@example.org>