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

Re: [BUG] zformat -f has no multibyte support

dana wrote on Thu, 26 Dec 2019 04:35 +00:00:
> On 24 Dec 2019, at 14:23, Daniel Shahaf <d.s@xxxxxxxxxxxxxxxxxx> wrote:
> > Actually, I don't suppose we could just call into the printf code directly, can
> > we?  It _works_ (see attachment), but it's not elegant.
> A very quick before/after test shows that it reduces performance quite a bit,
> especially as the number of format specs increases. Admittedly, it's only a
> few µs per spec in absolute numbers (at least on my Mac, with the handful of
> operations i tested),

What is the _factor_ of slowdown?  (Multiplicative, as opposed to additive)
I.e., does the patch make things slower by 1%, or 10%, or 100%, or 1000%?

> and i don't know how that would compare with a
> 'lower-level' approach. I assume that multi-byte support will incur *some*
> penalty no matter how it's done, so maybe it's reasonable, idk.

I don't have an intuition for what the penalty should be, but to get a
sense of the orders of magnitude involved we could the behaviour of the
'printf' builtin when built with and without multibyte support.



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