anchao opened a new pull request, #21339:
URL: https://github.com/apache/nuttx/pull/21339

   ## Summary                                                                   
                                                                                
                                                                                
                                                
                                                                                
                                                                                
                                                                                
                                                
   Optimize `lib_libvsprintf.c` by reducing per-character stream callbacks in 
common formatting paths.                                                        
                                                                                
                                                  
                                                                                
                                                                                
                                                                                
                                                
   This change builds on the existing literal and padding batching support, and 
further batches output for integer digits, symbol names, NaN/Inf strings, float 
exponent digits, and fixed-point zero runs. It also uses `strlen()` for 
unbounded `%s` formatting instead of `strnlen(..., ~0)`.
                                                                                
                                                                                
                                                                                
                                                
   ## Changes                                                                   
                                                                                
                                                                                
                                                
                                                                                
                                                                                
                                                                                
                                                
   - Use `strlen()` for `%s` when no precision is specified                     
                                                                                
                                                                                
                                                
   - Batch integer digit output for `%d`, `%u`, `%x`, `%X`, and pointer formats 
                                                                                
                                                                                
                                                
   - Batch `%pS` / `%ps` symbol name output                                     
                                                                                
                                                                                
                                                
   - Batch fixed `NaN` / `Inf` string output                                    
                                                                                
                                                                                
                                                
   - Batch exponent digits for `%e` / `%E`                                      
                                                                                
                                                                                
                                                
   - Batch consecutive zero output in fixed-point float formatting              
                                                                                
                                                                                
                                                
                                                                                
                                                                                
                                                                                
                                                
   ## Motivation                                                                
                                                                                
                                                                                
                                                
                                                                                
                                                                                
                                                                                
                                                
   `vsprintf` is used by both printf-style APIs and syslog paths, so avoiding 
repeated `putc` callbacks in hot formatting paths helps reduce formatting 
overhead. The changes keep the existing formatting behavior while using 
`puts`/repeat helpers where the output length is already known. 
                                                                                
                                                                                
                                                                                
                                                
   ## Testing                                                                   
                                                                                
                                                                                
                                                
   
   sim/usbdev
   qemu-armv8a/rpproxy
   qemu-armv8a/rpserver
   
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to