-
Notifications
You must be signed in to change notification settings - Fork 8
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
__smallest_size_t might be a huge pessimization on most arhitectures #53
Comments
Hi this sounds like a good area to research. I would expect this as well, considering the improvement in memory usage could be quickly voided by alignment. Though I am not expecting performance penalty this would result in. |
|
I have played around with this a bit, too, on a MacBook M1 with -O3. |
If have written a benchmark using the google benchmark utility. I can no longer see any statistically relevant difference. Please see my attachment for details. |
While a sound idea in theory, I fear that this optimization's impact on performance far outweights any benefits it brings in size. In the restricted testing I've done, for repeated calls to push_back, using an uint8_t/uint16_t as the size resulted in more than 10 times worse performance than when using std::size_t. I feel like this is something that should be investigated a bit if the implementation is to be used in a performance-critical context.
The text was updated successfully, but these errors were encountered: