Skip to content
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

<xlocinfo.h>: Reduce size of _Ctypevec, ctype<char>, ctype<wchar_t>, and ctype<unsigned short> #426

Closed
SunnyWar opened this issue Jan 17, 2020 · 4 comments
Labels
performance Must go faster vNext Breaks binary compatibility

Comments

@SunnyWar
Copy link
Contributor

SunnyWar commented Jan 17, 2020

_Ctypevec has some padding that can be eliminated by moving the pointers to the front. Here are the sizes before and after rearranging the members.

class _Ctypevec	size(32):
	+---
 0	| _Page
  	| <alignment member> (size=4)
 8	| _Table
16	| _Delfl
  	| <alignment member> (size=4)
24	| _LocaleName
	+---

class std::ctype<char>	size(48):	
class std::ctype<wchar_t>	size(96):
class std::ctype<unsigned short>	size(96):

///////////  After

class _Ctypevec	size(24):
	+---
 0	| _Table
 8	| _LocaleName
16	| _Page
20	| _Delfl
	+---		
class std::ctype<char>	size(40):
class std::ctype<wchar_t>	size(88):
class std::ctype<unsigned short>	size(88):

vNext note: Resolving this issue will require breaking binary compatibility. We won't be able to accept pull requests for this issue until the vNext branch is available. See #169 for more information.

@BillyONeal BillyONeal added enhancement Something can be improved performance Must go faster vNext Breaks binary compatibility labels Jan 17, 2020
@CaseyCarter CaseyCarter changed the title reduce size of _Ctypeveck, std::ctype<char>, std::ctype<wchar_t>, and std::ctype<unsigned short> reduce size of _Ctypevec, std::ctype<char>, std::ctype<wchar_t>, and std::ctype<unsigned short> Jan 17, 2020
@StephanTLavavej StephanTLavavej changed the title reduce size of _Ctypevec, std::ctype<char>, std::ctype<wchar_t>, and std::ctype<unsigned short> <xlocinfo.h>: Reduce size of _Ctypevec, ctype<char>, ctype<wchar_t>, and ctype<unsigned short> Jan 22, 2020
@StephanTLavavej
Copy link
Member

Relevant code:

STL/stl/inc/xlocinfo.h

Lines 64 to 69 in 2989323

struct _Ctypevec { // stuff needed by _Tolower, etc.
unsigned int _Page; // UINT
const short* _Table;
int _Delfl;
wchar_t* _LocaleName;
};

@SunnyWar
Copy link
Contributor Author

I assume pull requests for this cannot happen until #169 ?

@StephanTLavavej
Copy link
Member

That's correct. At the moment, vNext is lower priority than finishing the GitHub migration and C++20, so the branch won't be ready for a while - but it will happen.

@StephanTLavavej StephanTLavavej removed the enhancement Something can be improved label Feb 6, 2020
@SunnyWar
Copy link
Contributor Author

SunnyWar commented Aug 11, 2022

That's correct. At the moment, vNext is lower priority than finishing the GitHub migration and C++20, so the branch won't be ready for a while - but it will happen.

No, priority is now on C++23. History indicates this will not happen. Closing.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
performance Must go faster vNext Breaks binary compatibility
Projects
None yet
Development

No branches or pull requests

3 participants