-
Notifications
You must be signed in to change notification settings - Fork 845
Eliminates padding from some common structs #9481
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
|
+1. Great! I've wanted this for a long time! Let's tidy up little by little. |
|
Yeh, we've done this in the past as well, things just creeps up. I think longer term (intern maybe, good idea Craig) would be to make a very consistent layout of all structs and classes (in this order), one section for public and one section for private:
This won't solve all padding issues, but, it at least avoids a lot of them. Our HttpSM.h is particularly messy, I fixed some of it, but it was going back and forth between public / private. I fixed some of that, but not all. Additionally, it can help to arrange the public vs private sections in a way that the padding between the two is minimized. This may require reordering the list above around those boundaries. I used a tool call pahole for this. It's definitely not great, because of our class structures and stuff, and doesn't do an awesome job with classes. Maybe there are better tools to investigate, or, maybe just use |
| constexpr int MAX_THREADS_IN_EACH_TYPE = TS_MAX_THREADS_IN_EACH_THREAD_TYPE; | ||
| #else | ||
| constexpr int MAX_THREADS_IN_EACH_TYPE = 3072; | ||
| constexpr int MAX_THREADS_IN_EACH_TYPE = 3071; |
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.
This seems pretty rando.
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.
It was pretty random, I was going to restore it but ran into a squirrel, but making that odd also made it 16 bytes smaller for some reason ... Should we restore it? It'd be surprising if 3072 is a magic number that actually matters?
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.
Nah ya never know when you'll need 16 bytes.
* commit 'c54a2e2b77151869ff014fbdc4c82cec0afcbb8c': (37 commits) Slight performance improvements before calling APIHooks::clear (apache#9480) libswoc: Update to 1.4.5 (apache#9522) CryptoContext: Clean up to avoid compiler problem. (apache#9521) Add TLSCertSwitchSupport (apache#9322) Add clang-format-tests to clang-format target (apache#9456) Adds the AR env variable to config.nice (apache#9515) Fix .asf.yaml (apache#9519) Hugepage config cleanup (apache#9479) Separate io_uring into a separate library. AIO in io_uring mode uses new io_uring lib. (apache#9462) Avoid memory allocation in CryptoHash (apache#9474) UnitParser: add unit parser support. (apache#9485) autest - Minor fix on the verifier_client test ext to allow setting only the http3 ports. (apache#9517) Remove support for port event polling (apache#9476) QUIC: Add support to configure UDP max payload limit. (apache#9486) Reduce the size of the APIHooks, eliminating enum gap (apache#9509) Add support for CMCD-Request header nor field to prefetch plugin (apache#9232) Eliminates padding from some common structs (apache#9481) Enable external file loading for sni.yaml. (apache#9501) Remove inactive include of IpMapConf.h (apache#9512) Cleanup: Remove RecModeT from the code. (apache#9487) ...
There's still plenty to be done here, but this is pretty tedious work ... And have to be careful too, which I'm not known for ...