Brijesh-Thakkar commented on issue #18849:
URL: https://github.com/apache/nuttx/issues/18849#issuecomment-6359764761

   Hi @cederom, I'd like to work on this.
   
   Current master: #18840 / apache/nuttx-apps#3468 are merged, time_t and 
clock_t are
   int64_t, CONFIG_SYSTEM_TIME64 is gone. No open PR addresses #18849.
   
   I measured the cost of the #18840 series (nuttx 9a84223c1e -> end of series, 
same
   defconfig, arm-none-eabi-gcc 14.2.1 / avr-gcc 14.3.0):
   
   | config | text delta | total delta |
   |---|---|---|
   | stm32vldiscovery:nsh (Cortex-M3) | +1168 | +1248 |
   | nucleo-f072rb:nsh (Cortex-M0) | +1504 | +1520 |
   | breadxavr:nsh (AVR) | ... | ... |
   
   So the ~2 KB estimate in the issue looks about right for small parts.
   
   Side notes from testing: z80sim does not build with sdcc 4.5.0 even before 
#18840
   (sdcc rejects -isystem), and no z80/z16 config is in tools/ci/testlist, so I 
couldn't
   evaluate them. I'd suggest scoping this issue to AVR and small 32-bit parts 
first.
   Proposed staged plan:
   1. Add clock helpers in include/nuttx/clock.h (clock_add/sub/cmp, 
tick<->timespec)
      that default to today's int64_t operations, and convert sched/wdog, 
sched/timer and
      clock_systime_* to use them. Output should be byte-identical on existing 
configs.
   2. Let an arch override those helpers; prototype an AVR override to show a 
real size win.
   3. If still needed, a CONFIG option for a cheaper internal representation 
under the
      helpers, keeping the int64_t POSIX interface and using the existing 
seqlock for reads.
   4. Cheaper libc time conversions (gmtime/timegm/strftime) for small targets.
   Does this direction look right? Is a no-behavior-change helper PR OK as the 
first step?


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