From 0a9f58ea46151f982fc51c2f6b9992c7d9405da0 Mon Sep 17 00:00:00 2001 From: johnkerl Date: Wed, 18 Sep 2019 22:47:57 -0400 Subject: [PATCH] doc neatens --- doc/content-for-whyc-details.html | 8 +++++-- doc/whyc-details.html | 39 ++++++++++++++++++++++--------- perf/catrust.rs | 9 ------- perf/timings.txt | 22 +++++++++++++++++ 4 files changed, 56 insertions(+), 22 deletions(-) diff --git a/doc/content-for-whyc-details.html b/doc/content-for-whyc-details.html index c7fb7c1e2..457d39800 100644 --- a/doc/content-for-whyc-details.html +++ b/doc/content-for-whyc-details.html @@ -32,8 +32,8 @@ further look. commented out/in various steps of the cut steps and found (as noted in the source code below) big chunks of time in the simple map and write-to-stdout operations. I failed to retain cutc.c as I -originally implemented it (it morphed gradually into Miller per se) but it was -sufficiently faster than cutgo.go that I stuck with C for +originally implemented it in 2015 (it morphed gradually into Miller per se) but +it was sufficiently faster than cutgo.go that I stuck with C for implementing Miller.
  • The full Miller executable running mlr cat or mlr @@ -41,6 +41,10 @@ cut is slower than these bare-bones executables — I fully implemented Miller only in one language so there’s no apples-to-apples comparison with other languages. +
  • While C was the clear winner in these very simple tests, it’s quite possible +that had I committed to another language for full-featured Miller, it would have been +faster in that language. That was a gamble I did not take. +

    Source code

    diff --git a/doc/whyc-details.html b/doc/whyc-details.html index c28face34..023f397c1 100644 --- a/doc/whyc-details.html +++ b/doc/whyc-details.html @@ -221,6 +221,28 @@ pageTracker._trackPageview();
     ----------------------------------------------------------------
    +$ wc -l ../data/bigger
    +1000000 ../data/bigger
    +
    +$ ls -lh ../data/bigger
    +-rw----r-- 1 kerl kerl 59M Sep 18 21:47 ../data/bigger
    +
    +$ head ../data/bigger
    +a=pan,b=pan,i=1,x=0.3467901443380824,y=0.7268028627434533
    +a=eks,b=pan,i=2,x=0.7586799647899636,y=0.5221511083334797
    +a=wye,b=wye,i=3,x=0.20460330576630303,y=0.33831852551664776
    +a=eks,b=wye,i=4,x=0.38139939387114097,y=0.13418874328430463
    +a=wye,b=pan,i=5,x=0.5732889198020006,y=0.8636244699032729
    +a=zee,b=pan,i=6,x=0.5271261600918548,y=0.49322128674835697
    +a=eks,b=zee,i=7,x=0.6117840605678454,y=0.1878849191181694
    +a=zee,b=wye,i=8,x=0.5985540091064224,y=0.976181385699006
    +a=hat,b=wye,i=9,x=0.03144187646093577,y=0.7495507603507059
    +a=pan,b=wye,i=10,x=0.5026260055412137,y=0.9526183602969864
    +
    +----------------------------------------------------------------
    +$ justtime /bin/cat ../data/bigger > /dev/null
    +TIME IN SECONDS 0.008 -- /bin/cat ../data/bigger
    +
     justtime catc < ../data/bigger  > /dev/null
     TIME IN SECONDS 0.062 -- catc
     
    @@ -274,8 +296,8 @@ further look.
     commented out/in various steps of the cut steps and found (as
     noted in the source code below) big chunks of time in the simple map and
     write-to-stdout operations.  I failed to retain cutc.c as I
    -originally implemented it (it morphed gradually into Miller per se) but it was
    -sufficiently faster than cutgo.go that I stuck with C for
    +originally implemented it in 2015 (it morphed gradually into Miller per se) but
    +it was sufficiently faster than cutgo.go that I stuck with C for
     implementing Miller.
     
     
  • The full Miller executable running mlr cat or mlr @@ -283,6 +305,10 @@ cut is slower than these bare-bones executables — I fully implemented Miller only in one language so there’s no apples-to-apples comparison with other languages. +
  • While C was the clear winner in these very simple tests, it’s quite possible +that had I committed to another language for full-featured Miller, it would have been +faster in that language. That was a gamble I did not take. +

    Source code

    @@ -511,15 +537,6 @@ fn main() { print!("{}", line.unwrap()); } } - -//fn main() { -// let mut reader = io::stdin(); -// let mut line; -// loop { -// line = reader.read_line(); -// print!("{}\n", line); -// } -//}
  • diff --git a/perf/catrust.rs b/perf/catrust.rs index 4ec7126d7..1828bb996 100644 --- a/perf/catrust.rs +++ b/perf/catrust.rs @@ -6,12 +6,3 @@ fn main() { print!("{}", line.unwrap()); } } - -//fn main() { -// let mut reader = io::stdin(); -// let mut line; -// loop { -// line = reader.read_line(); -// print!("{}\n", line); -// } -//} diff --git a/perf/timings.txt b/perf/timings.txt index f532f044a..5bdd152f9 100644 --- a/perf/timings.txt +++ b/perf/timings.txt @@ -1,4 +1,26 @@ ---------------------------------------------------------------- +$ wc -l ../data/bigger +1000000 ../data/bigger + +$ ls -lh ../data/bigger +-rw----r-- 1 kerl kerl 59M Sep 18 21:47 ../data/bigger + +$ head ../data/bigger +a=pan,b=pan,i=1,x=0.3467901443380824,y=0.7268028627434533 +a=eks,b=pan,i=2,x=0.7586799647899636,y=0.5221511083334797 +a=wye,b=wye,i=3,x=0.20460330576630303,y=0.33831852551664776 +a=eks,b=wye,i=4,x=0.38139939387114097,y=0.13418874328430463 +a=wye,b=pan,i=5,x=0.5732889198020006,y=0.8636244699032729 +a=zee,b=pan,i=6,x=0.5271261600918548,y=0.49322128674835697 +a=eks,b=zee,i=7,x=0.6117840605678454,y=0.1878849191181694 +a=zee,b=wye,i=8,x=0.5985540091064224,y=0.976181385699006 +a=hat,b=wye,i=9,x=0.03144187646093577,y=0.7495507603507059 +a=pan,b=wye,i=10,x=0.5026260055412137,y=0.9526183602969864 + +---------------------------------------------------------------- +$ justtime /bin/cat ../data/bigger > /dev/null +TIME IN SECONDS 0.008 -- /bin/cat ../data/bigger + justtime catc < ../data/bigger > /dev/null TIME IN SECONDS 0.062 -- catc