summary refs log tree commit diff
path: root/src/exec.h
diff options
context:
space:
mode:
authorHerbert Xu <herbert@gondor.apana.org.au>2018-03-25 11:50:36 +0800
committerHerbert Xu <herbert@gondor.apana.org.au>2018-04-02 23:30:44 +0800
commit42b730b034eebd0e9da4aa014785a3ee5de436be (patch)
treeb56cfddd88e9eccf1fe5b5a6dcd4f255e5ea7c29 /src/exec.h
parentexpand: Fix ghost fields with unquoted $@/$* (diff)
downloaddash-42b730b034eebd0e9da4aa014785a3ee5de436be.tar.gz
dash-42b730b034eebd0e9da4aa014785a3ee5de436be.zip
builtin: Fix echo performance regression
The commit d6c0e1e2ffbf7913ab69d51cc794d48d41c8fcb1 ("[BUILTIN]
Handle embedded NULs correctly in printf") caused a performance
regression in the echo built-in because every echo call now goes
through the printf %b slow path where the string is always printed
twice to ensure the space padding is correct in the presence of
NUL characters.  In fact this regression applies to printf %b as
well.

This is easily fixed by making printf %b take the fast path when
no precision/field width modifiers are present.

This patch also changes the second strchurnul call to strspn which
generates slightly better code.

Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Diffstat (limited to '')
0 files changed, 0 insertions, 0 deletions
47 -0400'>2022-06-02Clean up parsing a littleJune McEnroe 2022-06-02Don't duplicate path stringJune McEnroe 2022-06-02Use stderr instead of /dev/tty, realloc buffer if lines too longJune McEnroe 2022-06-02Add initial working version of qfJune McEnroe 2022-05-29Set prompt for okshJune McEnroe0625b9284bde657896a7d4dffd13c9&follow=1'>Add DCH to shottyJune McEnroe 2019-07-12Support insert mode in shottyJune McEnroe 2019-07-11Don't do carriage return on line feedJune McEnroe 2019-07-11Interpret 256color-style SGRsJune McEnroe 2019-07-11Use inline style rather than <b>, <i>, <u>June McEnroe 2019-07-11Factor out clearJune McEnroe 2019-07-11Add bright option to shottyJune McEnroe 2019-07-11Output <b>, <i>, <u> in shottyJune McEnroe 2019-07-10Ignore SM and RMJune McEnroe 2019-07-09Add shotty man page and build itJune McEnroe 2019-07-09Add up -cJune McEnroe 2019-07-09Add options for default colors to shottyJune McEnroe 2019-07-08Use char literals consistentlyJune McEnroe