Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Re: Example / partial fix for printf with math expressions



On Sun, Feb 25, 2024 at 4:04 PM Bart Schaefer <schaefer@xxxxxxxxxxxxxxxx> wrote:
>
> However, I think you could change META_HEAPDUP and META_USEHEAP to
> META_NOALLOC, becuase you're re-metafying back into the same space
> that was originally unmetafied?  That might cut the performance
> penalty a lot.

No metafication:
zsh -c 'repeat 1000 printf %d 123_456+{1..10000}' > /dev/null  7.51s
user 0.39s system 99% cpu 7.907 total

USEHEAP:
Src/zsh -c 'repeat 1000 printf %d 123_456+{1..10000}' > /dev/null
8.62s user 0.59s system 99% cpu 9.218 total

NOALLOC:
Src/zsh -c 'repeat 1000 printf %d 123_456+{1..10000}' > /dev/null
7.89s user 0.36s system 99% cpu 8.255 total

All of this is with full debugging, an optimized compile might change it.




Messages sorted by: Reverse Date, Date, Thread, Author