anchao commented on PR #21340:
URL: https://github.com/apache/nuttx/pull/21340#issuecomment-6619820330

   > > > > Stack usage was also checked with `CONFIG_STACK_USAGE=y`. 
`vsprintf_internal()` itself is reduced from **320 bytes** to **192 bytes**, 
while the worst-case floating-point call chain may grow modestly because some 
extracted helpers are emitted as separate stack frames. The estimated 
worst-case path is around **650–720 bytes** with numbered arguments and 
floating-point enabled.
   > > > 
   > > > 
   > > > what's the benefit if no stack or code size reduce? @anchao
   > > 
   > > 
   > > The stack usage only increases in the worst-case path. For common cases 
that do not use floating-point formatting, the stack usage is reduced because 
the float-specific state is moved out of the main conversion path.
   > 
   > how many bytes will increase in the worst-case?
   
   The worst-case stack increase I measured is +16 bytes. The common non-float 
paths decrease: literal -96, string/integer about -112, char -16, wide string 
no change. The +16 case is the floating-point path, where vsprintf_internal 
drops by 192 bytes but the active helper chain (vsprintf_put_float + fixed/NaN 
helper + repeat) adds back slightly more than the old inline path.
   
   


-- 
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