We were using 'go run . <args>' before, which works fine, but does mean re-linking a new binary and throwing it away at each invocation. Given that the end-to-end tests don't do all that much work besides building the tiny red.go app, this amount of extra work was noticeable. We can obtain statistics for the JS sub-test, which used 'go run', via the perflock and benchcmd tools: $ go test -c $ perflock -governorp% benchcmd EndToEnd/JS ./gogio.test -test.run=EndToEnd/JS After capturing those numbers before and after the change, we can then compare them with benchstat. The CPU cost of the subtest is halved: name old time/op new time/op delta EndToEnd/JS 1.42s ± 2% 1.07s ± 3% -25.04% (p=0.008 n=5+5) name old user-time/op new user-time/op delta EndToEnd/JS 1.46s ± 3% 0.75s ± 5% -48.34% (p=0.008 n=5+5) name old sys-time/op new sys-time/op delta EndToEnd/JS 366ms ±13% 224ms ± 7% -38.79% (p=0.008 n=5+5) An alternative here would have been to refactor main.go to allow being called directly. However, that would have required a non-trivial refactor, since flag parsing is done via globals. Given that the TestMain method is asy and keeps the main function simple, we've decided to avoid a refactor. While at it, remove the sleep in the Android driver to wait for the app to come up on screen. Since we retry screenshots now, we no longer need a static sleep. On average, we still need one retry for the initial screenshot, but that's just 100ms versus the old 500ms. The maximum wait time is also 2s here, which should scale better for slower devices. Signed-off-by: Daniel Martí <mvdan@mvdan.cc>
Gio
Immediate mode GUI programs in Go for Android, iOS, macOS, Linux, FreeBSD, OpenBSD, Windows, and WebAssembly (experimental). See the project page gioui.org for documentation and more information.
Issues
File bugs and TODOs through the issue tracker or send an email to ~eliasnaur/gio@todo.sr.ht. For general discussion, use the mailing list: ~eliasnaur/gio@lists.sr.ht.
Contributing
Post discussion to the mailing list and patches to gio-patches. No Sourcehut account is required and you can post without being subscribed.
See the contribution guide for more details.
An unofficial GitHub mirror is kindly maintained by Larry Clapp.
License
This project is dual-licensed under the UNLICENSE (see the UNLICENSE file) or the MIT license (see the LICENSE-MIT file).
You may use the project under the terms of either license.