Hello Paolo, * Paolo Bonzini wrote on Thu, Oct 18, 2007 at 10:27:43AM CEST: >> >> I have no idea how many `w' commands can portably be used in a sed >> script > > GNU sed v3+: no limit (but typical Unix is 253) > ssed: no limit (but typical Unix is 253) > GNU sed v2.05: total no. of r and w commands may not exceed 32 > sedmod v1.0: 10 > HHsed v1.5: 10
Thanks. > I have two patches that try to limit sed overhead. Both avoid that sed > performs 80,000-odd regex matches per testgroup (instead, awk performs them > once per testsuite run). Yeah, regex matches are bad. > The second patch also avoids that sed reads in all the file once per > testgroup -- you realized that the cost of sed-extraction is quadratic in > the number of testgroups, RIGHT? :-) Sure did. Were you talking to me? ;-) > For both patches, test time improves by ~5% for testsuite -10, and slows > down slightly for running only one test. I like the second approach better, as the first is formally not a complexity reduction. I'm a bit disappointed that the improvement is not larger, though. Oh well. > I'm inclined to apply the second patch. Anybody disagrees? Could we name the tests after their normalized number, i.e., 017, so that `ls' file ordering is sane? I suppose it would be good to test the final patch with Solaris and AIX awk (I can do so). Should the individual test source files be deleted at the end, or even after each one is completed? Only if -d is not given? If you want to get crazy, you can let awk exit after extracting the last needed test. > 2007-10-18 Paolo Bonzini <[EMAIL PROTECTED]> > > * lib/autotest/general.m4 (at_func_test): Remove. > (AT_INIT): Pre-extract test groups into separate files. > (AT_CLEANUP): Source pre-extracted file instead of calling at_func_test. > @@ -369,7 +360,7 @@ at_status_file=$at_suite_dir/at-status > at_stdout=$at_suite_dir/at-stdout > at_stder1=$at_suite_dir/at-stder1 > at_stderr=$at_suite_dir/at-stderr > -# The file containing the function to run a test group. > +# The stem for files containing the function to run a test group. How about: # The stem for files containing a test group. > @@ -1347,11 +1355,7 @@ at_status=`cat "$at_status_file"` > [#AT_STOP_]AT_ordinal > m4_divert_pop([TEST_FUNCTIONS])dnl Back to KILL. > m4_divert_text([TESTS], > -[ AT_ordinal ) > - if at_func_test AT_ordinal && . "$at_test_source"; then :; else > - AS_ECHO(["$as_me: unable to parse test group: $[1]"]) >&2 Thanks for fixing^Wremoving my broken ($[1]) error message here. > - at_failed=: > - fi ;;]) > +[ AT_ordinal ) . "$at_test_source"-AT_ordinal ;; ]) > ])# AT_CLEANUP > Cheers, Ralf
