-
- Downloads
There was an error fetching the commit references. Please try again later.
builtin: Fix echo performance regression
The commit d6c0e1e2 ("[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>
Please register or sign in to comment