-
Notifications
You must be signed in to change notification settings - Fork 2.7k
Consolidate all history updates into one place. #1024
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
|
I prefer the original code... |
|
@vondele: Please rebase |
the two locations that previously did history updates is a similar way now call a common function, making search more easy to read, and making more explicit how the updates are performed. Performance neutral, more compact, and potentially enabling further simplifications. No functional change.
|
@zamar: done. |
|
I would say that the new code doesn't feel like a simplification to me, but rather like a complexification. Each introduction of a boolean parameter in a function introduce a readability headache, because it means the function has two execution paths which complicates the analysis (both at caller and callee points). The old See chapter 5 ("Avoid Candy Interfaces") of Steve Maguire's "Writing Solid Code": |
|
I agree with @snicolet |
|
@snicolet, @VoyagerOne, in addition to what I wrote before, the motivation for this patch is to make search<>() more easy to read, to avoid code duplication, and to make the code that updates the stats more localized in search.cpp. In more detail:
The number of arguments to update_all_stats is related to what updating the stats requires currently. It seemingly is rather complex, and that's the input the corresponding function needs. While the original form of the code might allow for an easier hack, the current form facilitates IMO better design. As I said in the original submission, I hope that this form inspires further simplifications. |
|
Results for 20 tests for each version: p-value: 0,808 |
|
I kind of see the point of this patch, but for me the new version is more difficult to read and understand than the original one... So I have to reject this patch. |
this last commit is on top of the PR #1021 (so should be rebase after that one is merged, by itself it goes as:
the two locations that previously did history updates is a similar way now call a common function.
Performance neutral, more compact, and potentially enabling further simplifications.
No functional change.