* Re: [Guile-commits] GNU Guile branch, master, updated. v2.1.0-68-g79eb47e [not found] <E1S13IJ-0005nd-Rk@vcs.savannah.gnu.org> @ 2012-02-26 21:38 ` Ludovic Courtès 2012-02-26 22:02 ` Andy Wingo 0 siblings, 1 reply; 5+ messages in thread From: Ludovic Courtès @ 2012-02-26 21:38 UTC (permalink / raw) To: Andy Wingo; +Cc: guile-devel Hello, "Andy Wingo" <wingo@pobox.com> skribis: > commit 79eb47ea47650ef42c545931726277a7118a0210 > Author: Andy Wingo <wingo@pobox.com> > Date: Fri Feb 24 23:05:02 2012 +0100 > > port i/o optimizations for iso-8859-1 > > * libguile/ports.h (scm_t_port_encoding_mode): > * libguile/ports.c (scm_c_make_port_with_encoding): > (scm_i_set_port_encoding_x): Add special treatment for latin1 > encoding. > (get_latin1_codepoint, get_codepoint): Add latin1 fast-path. > > * libguile/print.c (display_string_as_latin1): Add latin1 fastpath. The problems with fast paths is that they become less fast when there are many of them. How does this change influence ‘benchmark-suite/benchmarks/ports.bm’? Also, how important is it to treat Latin-1 specially? I can see that UTF-8 is important, because it’s ubiquitous and a Unicode encoding, but Latin-1... More importantly, there’s code duplication. > +/* Read an ISO-8859-1 codepoint (a byte) from PORT. On success, return > + *0 and set CODEPOINT to the codepoint that was read, fill BUF with > + *its UTF-8 representation, and set *LEN to the length in bytes. > + *Return `EILSEQ' on error. */ ESTARS Thanks, Ludo’. ^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [Guile-commits] GNU Guile branch, master, updated. v2.1.0-68-g79eb47e 2012-02-26 21:38 ` [Guile-commits] GNU Guile branch, master, updated. v2.1.0-68-g79eb47e Ludovic Courtès @ 2012-02-26 22:02 ` Andy Wingo 2012-02-27 15:57 ` Ludovic Courtès 0 siblings, 1 reply; 5+ messages in thread From: Andy Wingo @ 2012-02-26 22:02 UTC (permalink / raw) To: Ludovic Courtès; +Cc: guile-devel Hi! On Sun 26 Feb 2012 22:38, ludo@gnu.org (Ludovic Courtès) writes: > "Andy Wingo" <wingo@pobox.com> skribis: > >> commit 79eb47ea47650ef42c545931726277a7118a0210 >> Author: Andy Wingo <wingo@pobox.com> >> Date: Fri Feb 24 23:05:02 2012 +0100 >> >> port i/o optimizations for iso-8859-1 >> > The problems with fast paths is that they become less fast when there > are many of them. > > How does this change influence ‘benchmark-suite/benchmarks/ports.bm’? Dunno, that wasn't my benchmark. It makes the web server go faster (e.g. guile examples/web/debug-sxml.scm). The reason it makes sense to optimize for this encoding is because it's our narrow encoding. If we switch to utf-8 internally (for example), this path doesn't make sense any more. >> +/* Read an ISO-8859-1 codepoint (a byte) from PORT. On success, return >> + *0 and set CODEPOINT to the codepoint that was read, fill BUF with >> + *its UTF-8 representation, and set *LEN to the length in bytes. >> + *Return `EILSEQ' on error. */ > > ESTARS :) Will fix. Andy -- http://wingolog.org/ ^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [Guile-commits] GNU Guile branch, master, updated. v2.1.0-68-g79eb47e 2012-02-26 22:02 ` Andy Wingo @ 2012-02-27 15:57 ` Ludovic Courtès 2012-02-27 18:05 ` Andy Wingo 0 siblings, 1 reply; 5+ messages in thread From: Ludovic Courtès @ 2012-02-27 15:57 UTC (permalink / raw) To: Andy Wingo; +Cc: guile-devel Hi, Andy Wingo <wingo@pobox.com> skribis: > On Sun 26 Feb 2012 22:38, ludo@gnu.org (Ludovic Courtès) writes: > >> "Andy Wingo" <wingo@pobox.com> skribis: >> >>> commit 79eb47ea47650ef42c545931726277a7118a0210 >>> Author: Andy Wingo <wingo@pobox.com> >>> Date: Fri Feb 24 23:05:02 2012 +0100 >>> >>> port i/o optimizations for iso-8859-1 >>> >> The problems with fast paths is that they become less fast when there >> are many of them. >> >> How does this change influence ‘benchmark-suite/benchmarks/ports.bm’? > > Dunno, that wasn't my benchmark. It makes the web server go faster > (e.g. guile examples/web/debug-sxml.scm). Can you check with that benchmark? I think it’s important to have concrete figures when doing such a change, to make sure the performance/maintenance cost ratio is good. > The reason it makes sense to optimize for this encoding is because it's > our narrow encoding. I don’t see how Guile’s internal representation is relevant here, since we’re talking about input/output. UTF-8 is used very widely out there, and that’s why I’d consider it important to have fast UTF-8 I/O. The same cannot be said of Latin-1. Thanks, Ludo’. ^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [Guile-commits] GNU Guile branch, master, updated. v2.1.0-68-g79eb47e 2012-02-27 15:57 ` Ludovic Courtès @ 2012-02-27 18:05 ` Andy Wingo 2012-03-07 21:01 ` Ludovic Courtès 0 siblings, 1 reply; 5+ messages in thread From: Andy Wingo @ 2012-02-27 18:05 UTC (permalink / raw) To: Ludovic Courtès; +Cc: guile-devel Hi! On Mon 27 Feb 2012 16:57, ludo@gnu.org (Ludovic Courtès) writes: >>> How does this change influence ‘benchmark-suite/benchmarks/ports.bm’? >> >> Dunno, that wasn't my benchmark. It makes the web server go faster >> (e.g. guile examples/web/debug-sxml.scm). > > Can you check with that benchmark? I think it’s important to have > concrete figures when doing such a change, to make sure the > performance/maintenance cost ratio is good. Before: wingo@badger:~/src/guile-master$ ./benchmark-guile ports.bm Benchmarking /home/wingo/src/guile-master/meta/guile ... ports.bm with GUILE_LOAD_PATH=/home/wingo/src/guile-master/benchmark-suite ;; running guile version 2.1.0.43-4813a-dirty ;; calibrating the benchmarking framework... ;; framework time per iteration: 3.81469669342041e-8 ("ports.bm: peek-char: latin-1 port" 700000 user 0.08 benchmark 0.0532971231460571 bench/interp 0.0532971231460571 gc 0.0) ("ports.bm: peek-char: utf-8 port, ascii character" 700000 user 0.05 benchmark 0.0232971231460571 bench/interp 0.0232971231460571 gc 0.0) ("ports.bm: peek-char: utf-8 port, Korean character" 700000 user 0.08 benchmark 0.0532971231460571 bench/interp 0.0532971231460571 gc 0.0) ("ports.bm: read-char: latin-1 port" 10000000 user 0.7 benchmark 0.318530330657959 bench/interp 0.318530330657959 gc 0.0) ("ports.bm: read-char: utf-8 port, ascii character" 10000000 user 0.68 benchmark 0.298530330657959 bench/interp 0.298530330657959 gc 0.0) ("ports.bm: read-char: utf-8 port, Korean character" 10000000 user 0.68 benchmark 0.298530330657959 bench/interp 0.298530330657959 gc 0.0) ("ports.bm: char-ready?: latin-1 port" 10000000 user 0.57 benchmark 0.188530330657959 bench/interp 0.188530330657959 gc 0.0) ("ports.bm: char-ready?: utf-8 port, ascii character" 10000000 user 0.57 benchmark 0.188530330657959 bench/interp 0.188530330657959 gc 0.0) ("ports.bm: char-ready?: utf-8 port, Korean character" 10000000 user 0.57 benchmark 0.188530330657959 bench/interp 0.188530330657959 gc 0.0) ("ports.bm: rdelim: read-line" 1000 user 0.38 benchmark 0.379961853033066 bench/interp 0.297933677033066 gc 0.082028176) After: ;; running guile version 2.1.0.43-4813a-dirty ;; calibrating the benchmarking framework... ;; framework time per iteration: 3.81469669342041e-8 ("ports.bm: peek-char: latin-1 port" 700000 user 0.05 benchmark 0.0232971231460571 bench/interp 0.0232971231460571 gc 0.0) ("ports.bm: peek-char: utf-8 port, ascii character" 700000 user 0.05 benchmark 0.0232971231460571 bench/interp 0.0232971231460571 gc 0.0) ("ports.bm: peek-char: utf-8 port, Korean character" 700000 user 0.08 benchmark 0.0532971231460571 bench/interp 0.0532971231460571 gc 0.0) ("ports.bm: read-char: latin-1 port" 10000000 user 0.74 benchmark 0.358530330657959 bench/interp 0.358530330657959 gc 0.0) ("ports.bm: read-char: utf-8 port, ascii character" 10000000 user 0.76 benchmark 0.378530330657959 bench/interp 0.378530330657959 gc 0.0) ("ports.bm: read-char: utf-8 port, Korean character" 10000000 user 0.77 benchmark 0.388530330657959 bench/interp 0.388530330657959 gc 0.0) ("ports.bm: char-ready?: latin-1 port" 10000000 user 0.68 benchmark 0.298530330657959 bench/interp 0.298530330657959 gc 0.0) ("ports.bm: char-ready?: utf-8 port, ascii character" 10000000 user 0.64 benchmark 0.258530330657959 bench/interp 0.258530330657959 gc 0.0) ("ports.bm: char-ready?: utf-8 port, Korean character" 10000000 user 0.62 benchmark 0.238530330657959 bench/interp 0.238530330657959 gc 0.0) ("ports.bm: rdelim: read-line" 1000 user 0.39 benchmark 0.389961853033066 bench/interp 0.306389294033066 gc 0.083572559) The times are quite variable, though. Regards, Andy -- http://wingolog.org/ ^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [Guile-commits] GNU Guile branch, master, updated. v2.1.0-68-g79eb47e 2012-02-27 18:05 ` Andy Wingo @ 2012-03-07 21:01 ` Ludovic Courtès 0 siblings, 0 replies; 5+ messages in thread From: Ludovic Courtès @ 2012-03-07 21:01 UTC (permalink / raw) To: Andy Wingo; +Cc: guile-devel Hi, Andy Wingo <wingo@pobox.com> skribis: > Hi! > > On Mon 27 Feb 2012 16:57, ludo@gnu.org (Ludovic Courtès) writes: > >>>> How does this change influence ‘benchmark-suite/benchmarks/ports.bm’? >>> >>> Dunno, that wasn't my benchmark. It makes the web server go faster >>> (e.g. guile examples/web/debug-sxml.scm). >> >> Can you check with that benchmark? I think it’s important to have >> concrete figures when doing such a change, to make sure the >> performance/maintenance cost ratio is good. > > Before: > > wingo@badger:~/src/guile-master$ ./benchmark-guile ports.bm > Benchmarking /home/wingo/src/guile-master/meta/guile ... ports.bm > with GUILE_LOAD_PATH=/home/wingo/src/guile-master/benchmark-suite > ;; running guile version 2.1.0.43-4813a-dirty > ;; calibrating the benchmarking framework... > ;; framework time per iteration: 3.81469669342041e-8 > ("ports.bm: peek-char: latin-1 port" 700000 user 0.08 benchmark 0.0532971231460571 bench/interp 0.0532971231460571 gc 0.0) > ("ports.bm: peek-char: utf-8 port, ascii character" 700000 user 0.05 benchmark 0.0232971231460571 bench/interp 0.0232971231460571 gc 0.0) > ("ports.bm: peek-char: utf-8 port, Korean character" 700000 user 0.08 benchmark 0.0532971231460571 bench/interp 0.0532971231460571 gc 0.0) > ("ports.bm: read-char: latin-1 port" 10000000 user 0.7 benchmark 0.318530330657959 bench/interp 0.318530330657959 gc 0.0) > ("ports.bm: read-char: utf-8 port, ascii character" 10000000 user 0.68 benchmark 0.298530330657959 bench/interp 0.298530330657959 gc 0.0) > ("ports.bm: read-char: utf-8 port, Korean character" 10000000 user 0.68 benchmark 0.298530330657959 bench/interp 0.298530330657959 gc 0.0) > ("ports.bm: char-ready?: latin-1 port" 10000000 user 0.57 benchmark 0.188530330657959 bench/interp 0.188530330657959 gc 0.0) > ("ports.bm: char-ready?: utf-8 port, ascii character" 10000000 user 0.57 benchmark 0.188530330657959 bench/interp 0.188530330657959 gc 0.0) > ("ports.bm: char-ready?: utf-8 port, Korean character" 10000000 user 0.57 benchmark 0.188530330657959 bench/interp 0.188530330657959 gc 0.0) > ("ports.bm: rdelim: read-line" 1000 user 0.38 benchmark 0.379961853033066 bench/interp 0.297933677033066 gc 0.082028176) > > After: > > ;; running guile version 2.1.0.43-4813a-dirty > ;; calibrating the benchmarking framework... > ;; framework time per iteration: 3.81469669342041e-8 > ("ports.bm: peek-char: latin-1 port" 700000 user 0.05 benchmark 0.0232971231460571 bench/interp 0.0232971231460571 gc 0.0) > ("ports.bm: peek-char: utf-8 port, ascii character" 700000 user 0.05 benchmark 0.0232971231460571 bench/interp 0.0232971231460571 gc 0.0) > ("ports.bm: peek-char: utf-8 port, Korean character" 700000 user 0.08 benchmark 0.0532971231460571 bench/interp 0.0532971231460571 gc 0.0) > ("ports.bm: read-char: latin-1 port" 10000000 user 0.74 benchmark 0.358530330657959 bench/interp 0.358530330657959 gc 0.0) > ("ports.bm: read-char: utf-8 port, ascii character" 10000000 user 0.76 benchmark 0.378530330657959 bench/interp 0.378530330657959 gc 0.0) > ("ports.bm: read-char: utf-8 port, Korean character" 10000000 user 0.77 benchmark 0.388530330657959 bench/interp 0.388530330657959 gc 0.0) > ("ports.bm: char-ready?: latin-1 port" 10000000 user 0.68 benchmark 0.298530330657959 bench/interp 0.298530330657959 gc 0.0) > ("ports.bm: char-ready?: utf-8 port, ascii character" 10000000 user 0.64 benchmark 0.258530330657959 bench/interp 0.258530330657959 gc 0.0) > ("ports.bm: char-ready?: utf-8 port, Korean character" 10000000 user 0.62 benchmark 0.238530330657959 bench/interp 0.238530330657959 gc 0.0) > ("ports.bm: rdelim: read-line" 1000 user 0.39 benchmark 0.389961853033066 bench/interp 0.306389294033066 gc 0.083572559) > > The times are quite variable, though. Thanks for running the bench! That’s not very conclusive, though. I improved ports.bm in stable-2.0 (in particular, the ‘read-char’ benchmarks made little sense before as they quickly reached EOF). It would be ideal if you could try it, and use --iteration-factor to have longer timings. Thanks, Ludo’. ^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2012-03-07 21:01 UTC | newest] Thread overview: 5+ messages (download: mbox.gz follow: Atom feed -- links below jump to the message on this page -- [not found] <E1S13IJ-0005nd-Rk@vcs.savannah.gnu.org> 2012-02-26 21:38 ` [Guile-commits] GNU Guile branch, master, updated. v2.1.0-68-g79eb47e Ludovic Courtès 2012-02-26 22:02 ` Andy Wingo 2012-02-27 15:57 ` Ludovic Courtès 2012-02-27 18:05 ` Andy Wingo 2012-03-07 21:01 ` Ludovic Courtès
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox; as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).