is failing me.
I want like, a basic text writer utility that writes to an underlying io.Writer
I want to avoid using fmt.Fprintx. I don't want to use formatting directives. I want to write exactly what I'm going to write idealy. Something like
writer.WriteInt(12)
Is that in the stdlib? Or do people use a lib for that
What do you want WriteInt to do? Write the characters or write 4 bytes representing the actual integer value?
Write the characters, specifically I want a "text based" writer. So this logic applies for floats as well
https://pkg.go.dev/fmt#Fprint
Great question! Fprint is still slower. Fprint also doesn't let you specify how you want stuff like floats formatted.
fastest writer is hand-written writer
probably not noticable at all 🙂
and seems to consume about-the-least memory per op
scale this up to millions of writes... signifigant
scale this up to millions of writes... signifigant
scale this up to millions of writes... significant
then it's part of your hot path and it does matter
I meant it does matter, the optimization is justifiable 🙂
Обсуждают сегодня