-
Notifications
You must be signed in to change notification settings - Fork 16
Multiple small test optimizations based on lib/bats/helper-function
#162
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Part of #156. More improvements via application of `set "$DISABLE_BATS_SHELL_OPTIONS"` and `restore_bats_shell_options`. Also updated `set_bats_test_suite_name` to avoid creating a subshell, which should help Windows test times in particular. Timing for `./go test` under Bash 3.2.57(1)-release on my MacBook Pro with a 2.9GHz Intel Core i5 CPU and 8GB 1867MHz DDR3 RAM went from the following for the previous commit: 784 tests, 0 failures, 2 skipped real 4m16.466s user 2m1.907s sys 2m2.015s to: real 4m4.359s user 1m56.615s sys 1m54.992s
Part of #156. More improvements via application of `set "$DISABLE_BATS_SHELL_OPTIONS"` and `restore_bats_shell_options`. Timing for the following command: ./go test test commands complete complete/command-path modules under Bash 3.2.57(1)-release on my MacBook Pro with a 2.9GHz Intel Core i5 CPU and 8GB 1867MHz DDR3 RAM went from the following for the previous commit: 123 tests, 0 failures real 1m40.351s user 0m40.210s sys 0m49.741s to: 123 tests, 0 failures real 0m34.757s user 0m16.955s sys 0m15.780s
Part of #156. Timing for `./go test assertion-test-helpers` under Bash 3.2.57(1)-release on my MacBook Pro with a 2.9GHz Intel Core i5 CPU and 8GB 1867MHz DDR3 RAM went from the following for the previous commit: 18 tests, 0 failures real 0m6.787s user 0m3.259s sys 0m3.104s to: 18 tests, 0 failures real 0m5.907s user 0m2.912s sys 0m2.603s
Part of #165. The performance impact is nil on macOS, but I expect it will be substantial on Windows.
Part of #156. Timing for `./go test builtins` under Bash 3.2.57(1)-release on my MacBook Pro with a 2.9GHz Intel Core i5 CPU and 8GB 1867MHz DDR3 RAM went from the following for the previous commit: 9 tests, 0 failures real 0m1.543s user 0m0.782s sys 0m0.692s to: real 0m1.078s user 0m0.595s sys 0m0.433s
Missed this in #157.
Part of #156. Though the performance benefit is only about 0.2s on my MacBook Pro, this eliminates a `while` loop and removes several vestigial `test_printf` calls, which should reflect a marked improvement in performance on Windows. However, this is an improvement to the existing code regardless.
Part of #156. Like the previous commit, this only produces about a 0.25s improvement on my MacBook Pro, but expect the improvement on Windows to be more substantial. Also removes a vestigial `_GO_USE_MODULES` call from a test script, which is no longer necessary since `@go.test_compgen` sources the necessary modules anyway.
Part of #156. Timing for `./go test kcov` under Bash 3.2.57(1)-release on my MacBook Pro with a 2.9GHz Intel Core i5 CPU and 8GB 1867MHz DDR3 RAM went from the following for the previous commit: 17 tests, 0 failures real 0m7.836s user 0m3.436s sys 0m3.889s to: real 0m3.932s user 0m1.847s sys 0m1.770s
Part of #156. Again, about a 0.2s improvement on my MacBook Pro, but anticipating greater improvement on Windows.
Part of #156. Timing for `./go test glob/arg-completion` under Bash 3.2.57(1)-release on my MacBook Pro with a 2.9GHz Intel Core i5 CPU and 8GB 1867MHz DDR3 RAM went from the following for the previous commit: 17 tests, 0 failures real 0m6.368s user 0m3.047s sys 0m3.141s to: 17 tests, 0 failures real 0m4.165s user 0m2.150s sys 0m1.910s
Part of #156. Again, about a 0.2s improvement on my MacBook Pro, but anticipating greater improvement on Windows.
Part of #156. About a 0.7s improvement on my MacBook Pro, but anticipating greater improvement on Windows.
Part of #156. About a 0.15s improvement on my MacBook Pro, but anticipating greater improvement on Windows.
Part of #156. Timing for `./go test complete` under Bash 3.2.57(1)-release on my MacBook Pro with a 2.9GHz Intel Core i5 CPU and 8GB 1867MHz DDR3 RAM went from the following for the previous commit: 10 tests, 0 failures real 0m4.536s user 0m2.158s sys 0m2.162s to: 10 tests, 1 failure real 0m3.133s user 0m1.575s sys 0m1.406s
Part of #156. Timing for `./go test fullpath` under Bash 3.2.57(1)-release on my MacBook Pro with a 2.9GHz Intel Core i5 CPU and 8GB 1867MHz DDR3 RAM went from the following for the previous commit: 6 tests, 0 failures real 0m1.625s user 0m0.773s sys 0m0.807s to: 6 tests, 0 failures real 0m1.115s user 0m0.548s sys 0m0.516s
Part of #156. About a 0.2s improvement on my MacBook Pro, but anticipating greater improvement on Windows.
Part of #156. Very minor O(0.05s) benefit, but every little bit counts, especially on Windows.
Part of #156. Very minor O(0.05s) benefit, but every little bit counts, especially on Windows. At this point, the timing for `./go test` under Bash 3.2.57(1)-release on my MacBook Pro with a 2.9GHz Intel Core i5 CPU and 8GB 1867MHz DDR3 RAM went from the following for the merge commit for #161: 784 tests, 0 failures, 2 skipped real 4m16.466s user 2m1.907s sys 2m2.015s to: real 3m2.408s user 1m31.395s sys 1m21.114s
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Part of #156. At this point, the timing for
./go testunder Bash 3.2.57(1)-release on my MacBook Pro with a 2.9GHz Intel Core i5 CPU and 8GB 1867MHz DDR3 RAM went from the following for the merge commit for #161:to: