-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 According to Paolo Bonzini on 10/9/2007 2:14 AM: > >>> Anybody figured out where autotest spends time *at runtime*? I tried >>> to track something there, but never really got anywhere. >> >> Easy: parsing. Even with >> cd autoconf/tests && ./testsuite 1 > > Cool, so my patches will indeed speed up run-time a little bit. Or more > accurately, initialization time, because parsing is done only once. > > Indeed, to verify if the shell parsed the case statement 300+ times, I > tried separating each test group into a shell function. That moved the > parsing from happening "after writing the heading" to "before writing > the heading", but it did not speed up the testsuite at all (it actually > lost 1-2%).
Speaking of parsing, shouldn't the shell functions be AFTER the arg parsing, so that 'testsuite --help' executes faster? One of my ideas (although I haven't had time to try it out yet) would be to have the shell skip parsing the tests altogether. Instead, emit the tests at the end of the file, with clear delimiters, and have the case/esac statement merely invoke a shell function whose job is to invoke sed on $0, extracting the well-labeled portion of the rest of the file belonging to that test into at-test, then sourcing that file. That way, the shell doesn't have to parse the tests it doesn't execute. Your patch may prove to be a starting point towards this idea. - -- Don't work too hard, make some time for fun as well! Eric Blake [EMAIL PROTECTED] -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.5 (Cygwin) Comment: Public key at home.comcast.net/~ericblake/eblake.gpg Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iD8DBQFHDaQR84KuGfSFAYARAg3zAKCuh++UbyOXdSfRp+XB5wp3dkFEnACgxAG2 G8iaWauS994i5PIUOeadIzk= =UNDB -----END PGP SIGNATURE-----
