Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Using strings in helper functions causes a lot of string-to-[]byte allocations. This fix is centered around converging the tag() helper func to the []byte lingo. In order to do that, a lot of string literals have moved to global variables, where string to []byte conversion can happen once.
- Loading branch information
31f2685
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@rtfb This is good. I just want to make a comment that sometimes doing
w.WriteString(str)
can be as performant asw.Write(b)
, if you have a writer that efficiently implementsWriteString
method. Just FYI.31f2685
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Probably not applicable here since we take an
io.Writer
as input in the API.