zsh-workers
 help / color / mirror / code / Atom feed
From: Bart Schaefer <schaefer@brasslantern.com>
To: Zsh hackers list <zsh-workers@zsh.org>
Subject: Re: Example / partial fix for printf with math expressions
Date: Mon, 26 Feb 2024 09:12:50 -0800	[thread overview]
Message-ID: <CAH+w=7YHDnTkZB2j2i3rtww0DSO7m=+vhggO6L0rwmhtKWampg@mail.gmail.com> (raw)
In-Reply-To: <CAH+w=7bZBQNvft8cqQ7CahMsF9=cMGEYTbpfLOidQH=4kc5HeA@mail.gmail.com>

On Sun, Feb 25, 2024 at 4:04 PM Bart Schaefer <schaefer@brasslantern.com> 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.


      reply	other threads:[~2024-02-26 17:13 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-02-23 23:23 Bart Schaefer
2024-02-24 14:40 ` Stephane Chazelas
2024-02-24 15:10   ` Stephane Chazelas
2024-02-24 21:51   ` Bart Schaefer
2024-02-25  6:54   ` Stephane Chazelas
2024-02-26  0:04     ` Bart Schaefer
2024-02-26 17:12       ` Bart Schaefer [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='CAH+w=7YHDnTkZB2j2i3rtww0DSO7m=+vhggO6L0rwmhtKWampg@mail.gmail.com' \
    --to=schaefer@brasslantern.com \
    --cc=zsh-workers@zsh.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/zsh/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).