-
Notifications
You must be signed in to change notification settings - Fork 1.4k
Optimize tvectort cache #20631
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
Optimize tvectort cache #20631
Conversation
|
Hi @muhammadalhroob, could you please rebase your new commit on the current Also, just for curiousity: what made you start working on TMatrix/TVector performance optimization? Do you have a concrete usecase that you need to speed up? We're always interested in hearing how people are using ROOT! |
|
Not sure if reordering class members requires bumping class version ?
@pcanal does reordering or "alignas" modifiers require it? |
Unfortunately
It does as it changes the order in which the data members are stored on file.
Please include the test you made, at the very least in the description and even better as a test.
Either limit white space changes to the lines changed in this PR or segregate them into their own commit (or even better, their own PR). |
pcanal
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
See comments.
fd14020 to
476426c
Compare
|
Hi @guitargeek, Regarding the interest in optimising: |
|
Hi @muhammadalhroob, ROOT doesn't allow PR branches that are not related to the current Can you please checkout the current master branch, cherry pick your new commit "Optimize TVectorT data layout for cache locality", and then force push to this PR branch? Then we can see where we stand. |
Also, usually header files (especially old ones) are aligned on purpose "against" clang-format-style, for example to easily sort them alphabetically by padding spaces after the return type. |
Thanks for the clarification! ROOT has a dedicated package for optimized matrix and vector multiplications called SMatrix, which is supposed to be faster than TMatrix. No users rely on TMatrix/TVector for performance critical code, as they are faster alternative for linear algebra also outside ROOT. So I don't think it's time well invested to optimize these classes further. So just because these optimizations are easy to do with AI, it doesn't mean that we should do it. It doesn't come for free: there is review overhead, and every change risks breaking things. Even if it's just a refactor or optimization. It you want to contribute to ROOT, I would encourage you to focus either on improvements that improve your own life or the ones of your ATLAS colleagues, or take a look at our GitHub issue tracker and see if there is something you can pick up and help with! Just my 2 cents. Indeed, AI is great for writing test macros 🙂 |
|
Also: AI might get one into trouble in some (very) rare cases if it copied verbatim from a copyrighted code doing that particular operation. |
ee672d7 to
f13784f
Compare
Those cases are not that rare and in general the practice of regurgitating LLM output straight into PRs is dangerous and sloppy. Considering also what @guitargeek pointed out, I propose closing this PR. |
|
Dear all, Cheers, |
|
Yes, thank you very much! Given that there is no clear motivation, I'd appreciate if this PR gets closed. Thank you for your understanding! |
benchVector.C
This Pull request:
Performance: +30-35% faster element access on heap vectors (50-10k elements)
No regressions on small-vector (stack) path or correctness.
Changes or fixes:
Checklist: