Add PyLATIN1Object for single byte latin1 strings #305
kumaraditya303
started this conversation in
Ideas
Replies: 2 comments 3 replies
-
latin1 != utf8. We need utf8 cache for latin1 string. |
Beta Was this translation helpful? Give feedback.
3 replies
-
Another idea. Limit unicode length to 56bit on 64bit platform. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
While working on python/cpython#31616, I noticed that only ascii strings use
PyASCIIObject
whereas latin1 strings usePyCompactUnicodeObject
withutf8_length = 0, utf8 = 0x0, wstr_length = 0
set which wastes space, so instead ofPyASCIIObject
, we can havePyLATIN1Object
since latin1 is in range(255) it can be stored in theuint8_t
and not waste space.This is only for strings of size 1.
Layout:
New layout of
PyLATIN1Object
:Beta Was this translation helpful? Give feedback.
All reactions