-
Notifications
You must be signed in to change notification settings - Fork 1.5k
reduced usage of mutable Settings objects in tests
#4798
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
Conversation
|
This is to gain initial feedback on the approach. I will adjust all test then. I also have other PRs which need to be merged first to avoid conflicts. |
6ca74d2 to
ab0b8d0
Compare
Settings objects in testsSettings objects in tests
7555687 to
9575e90
Compare
|
This needs many other PRs merge first and we also need to adapt #4785 as a |
|
Turns out they are not mutable. I accidentally made objects |
348cb67 to
24c5953
Compare
ed69e1c to
e7a8c98
Compare
761c51b to
28ad381
Compare
7bc59be to
edb0174
Compare
|
you are making various Settings objects static. Why? |
So they are not instantiated on each test case but only once. Especially if library loading (or copying) is involved that is consuming unnecessary CPU. |
|
I would not make local objects static just to save a few cpu cycles. Can we please stop with all these micro optimisations that only saves a few cpu cycles. It's more important with readability. Also these objects will then use some mutexes to make these objects threadsafe that has a penalty also. |
|
Could you show some stats. With static or without static. I wonder if you can test that: |
I will give it a spin. It is quite possible this PR is not showing the gains yet and is even showing a slight regression since I introduced several copies which weren't there before and won't be removed until I have applied all changes. I could add the follow-up changes to this PR as well but I would prefer not to make this even bigger than it already is. There's also some general change to the way we provide the settings to the common |
|
Doing tests I am getting some inconsistent results which is strange. So I will drop the |
ok thanks as far as I remember that was my biggest concern. There is now some conflict.. |
…sBuilder::library()`
…ges in another merge
Currently the
Settingsobjects in the tests are all mutable. This might cause some tests to modify the settings as they also contain run-time information which will be used by subsequent tests using the same object.We should make sure that they are
constif possible. Otherwise we need to make sure the tests will always be run on a a fixed configuration.