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

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



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), 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.

The only other thing i'd worry about is the user having to micro-manage REPLY,
but it looks like the way you've done it avoids any issues with that.

dana



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