Repository navigation
Conversation
|
The following sections might be updated with supplementary metadata relevant to reviewers and maintainers. External sites
ReviewsSee the guideline and AI policy for information on the review process.
If your review is incorrectly listed, please copy-paste ConflictsReviewers, this pull request conflicts with the following ones:
If you consider this pull request important, please also help to review the conflicting pull requests. Ideally, start with the one that should be merged first. |
|
Concept ACK, seems worthwhile to me. |
|
Concept ACK, probably good to turn this on by default with a reasonable threshold. For singleton types ( |
|
🚧 At least one of the CI tasks failed. HintsTry to run the tests locally, according to the documentation. However, a CI failure may still
Leave a comment here, if you need help tracking down a confusing failure. |
|
Concept ACK for me too. I had not included other classes in the original PR because they are probably instantiated far less than 1 million times at once, so the changes seemed not worth it to me (sometimes members are ordered by fonctionality, code might be more understandable that way). But if there is now a CI check to avoid potentially losing more memory in the future, I'm all for it. It seems the limit of 23 is not properly used though, since the CI output warns about a loss of 11 padding bytes? |
|
Is this really worth it? This could make the code harder to read by having fields that belong together split further apart. See e.g. the mempool "rolling" section. I'd say this should be an opt-in list for structs where we know they exist 1000s of times and that would benefit low-resource systems. E.g. saving 24kB on systems that have set 2000 connections (#35919), so likely they are not low-memory systems, seems a rounding error. So my preference would be to have this opt-in per-struct and accommodate each change with a measurement, or at least a guess of how much it would save. |
|
|
||
| std::string methodName; //!< method whose params want conversion | ||
| int paramIdx; //!< 0-based idx of param to convert | ||
| std::string paramName; //!< parameter name |
There was a problem hiding this comment.
if memory usage was a concern here, those should be string_view
| mutable int64_t lastRollingFeeUpdate GUARDED_BY(cs){GetTime()}; | ||
| mutable bool blockSinceLastRollingFeeBump GUARDED_BY(cs){false}; | ||
| mutable double rollingMinimumFeeRate GUARDED_BY(cs){0}; //!< minimum fee to get into the pool, decreases exponentially | ||
|
|
There was a problem hiding this comment.
splitting this up makes the code harder to read for no benefit?
|
Not sure the tidy check makes sense (as @maflcko also mentioned, for classes with only a few instances in total, readability can matter more), but we could keep this open as a guide for similar changes, so we can consider them on a case-by-case basis. |
|
🚧 At least one of the CI tasks failed. HintsTry to run the tests locally, according to the documentation. However, a CI failure may still
Leave a comment here, if you need help tracking down a confusing failure. |
In bitcoin#36501 we reordered fields in `CBlock` to save 8 bytes. Add the clang-tidy padding check, leave the warning threshold (explicitly) at the default of 24 bytes. https://clang.llvm.org/docs/analyzer/checkers.html#optin-performance-padding
c2f15bb to
2d1b3f9
Compare

Enable
optin.performance.Paddingwith the default of 24 bytes (made explicit in the clang-tidy config), after fixing warnings for more padding than that. Enabling it at this point would be to catch regressions above this amount.Based on #36501, which reorders
CBlockIndexto save 8 bytes (clang-tidyalso warns about this). Wondering if contributors/reviewers think this is worthwhile given we may make that refactor? Also not sure if it's possible for us to enable this generally, as padding will differ depending on various factors.