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?
 Eli
                          Davis
                        
                      
                    
                    
                    
                    
                      Автор вопроса
                      
                      
                        
                          Eli
                          Davis
                        
                      
                    
                    
                    
                    
                      Автор вопроса
                    
                    
                  Write the characters, specifically I want a "text based" writer. So this logic applies for floats as well
 Eli
                          Davis
                        
                      
                    
                    
                    
                    
                      Автор вопроса
                      
                      
                        
                          Eli
                          Davis
                        
                      
                    
                    
                    
                    
                      Автор вопроса
                    
                    
                   pretty happy with this. Def recommend making a cus...
                      
                      pretty happy with this. Def recommend making a cus...
                    https://pkg.go.dev/fmt#Fprint
 Eli
                          Davis
                        
                      
                    
                    
                    
                    
                      Автор вопроса
                      
                      
                        
                          Eli
                          Davis
                        
                      
                    
                    
                    
                    
                      Автор вопроса
                    
                    
                  Great question! Fprint is still slower. Fprint also doesn't let you specify how you want stuff like floats formatted.
 Great question! Fprint is still slower.
Fprint al...
                      
                      Great question! Fprint is still slower.
Fprint al...
                    fastest writer is hand-written writer
probably not noticable at all 🙂
and seems to consume about-the-least memory per op
 Eli
                          Davis
                        
                      
                    
                    
                    
                    
                      Автор вопроса
                      
                      
                        
                          Eli
                          Davis
                        
                      
                    
                    
                    
                    
                      Автор вопроса
                    
                    
                  scale this up to millions of writes... signifigant
 Eli
                          Davis
                        
                      
                    
                    
                    
                    
                      Автор вопроса
                      
                      
                        
                          Eli
                          Davis
                        
                      
                    
                    
                    
                    
                      Автор вопроса
                    
                    
                  scale this up to millions of writes... signifigant
 Eli
                          Davis
                        
                      
                    
                    
                    
                    
                      Автор вопроса
                      
                      
                        
                          Eli
                          Davis
                        
                      
                    
                    
                    
                    
                      Автор вопроса
                    
                    
                  scale this up to millions of writes... significant
 Eli
                          Davis
                        
                      
                    
                    
                    
                    
                      Автор вопроса
                      
                      
                        
                          Eli
                          Davis
                        
                      
                    
                    
                    
                    
                      Автор вопроса
                    
                    
                  then it's part of your hot path and it does matter
I meant it does matter, the optimization is justifiable 🙂
Обсуждают сегодня