Re: [Toybox] [PATCH] Speed up tail.test for shells without builtin printf.

2017-04-14 Thread enh
ping?

On Fri, Apr 7, 2017 at 11:19 PM, enh  wrote:

>
> The test only needs echo, and Android currently doesn't use mksh's
> builtin printf; the toybox printf is fuller featured and less buggy,
> but a lot slower to call in a loop like this (and mksh doesn't fall
> back to the printf on the path if given something it can't handle,
> so we can't have the best of both worlds).
>
> Without this hack, the tail test takes as long as all the other
> tests put together.
> ---
>  tests/tail.test | 5 ++---
>  1 file changed, 2 insertions(+), 3 deletions(-)
>
>


-- 
Elliott Hughes - http://who/enh - http://jessies.org/~enh/
Android native code/tools questions? Mail me/drop by/add me as a reviewer.
___
Toybox mailing list
Toybox@lists.landley.net
http://lists.landley.net/listinfo.cgi/toybox-landley.net


[Toybox] [PATCH] Speed up tail.test for shells without builtin printf.

2017-04-08 Thread enh
The test only needs echo, and Android currently doesn't use mksh's
builtin printf; the toybox printf is fuller featured and less buggy,
but a lot slower to call in a loop like this (and mksh doesn't fall
back to the printf on the path if given something it can't handle,
so we can't have the best of both worlds).

Without this hack, the tail test takes as long as all the other
tests put together.
---
 tests/tail.test | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)
From 6a029bbba68122ff5c23a4da058db07be9d526c2 Mon Sep 17 00:00:00 2001
From: Elliott Hughes 
Date: Fri, 7 Apr 2017 23:15:52 -0700
Subject: [PATCH] Speed up tail.test for shells without builtin printf.

The test only needs echo, and Android currently doesn't use mksh's
builtin printf; the toybox printf is fuller featured and less buggy,
but a lot slower to call in a loop like this (and mksh doesn't fall
back to the printf on the path if given something it can't handle,
so we can't have the best of both worlds).

Without this hack, the tail test takes as long as all the other
tests put together.
---
 tests/tail.test | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/tests/tail.test b/tests/tail.test
index 81dc871..b148aeb 100755
--- a/tests/tail.test
+++ b/tests/tail.test
@@ -43,13 +43,12 @@ testing "noseek -c+ out of bonds" "tail -c +999" "" "" "$BIGTEST"
 
 makebigfile()
 {
-
   for j in $(seq 1 100)
   do
-printf "%s " $j
+echo -n "$j "
 for i in $(seq 1 100)
 do
-  printf %s 123456789abcefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ
+  echo -n 123456789abcefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ
 done
 echo
   done
-- 
2.12.2.715.g7642488e1d-goog

___
Toybox mailing list
Toybox@lists.landley.net
http://lists.landley.net/listinfo.cgi/toybox-landley.net