4 ms·
> Java ... They all use 2 byte encodings No, not anything that is OpenJDK 9+ based which uses 1 byte where possible. > They all use UTF-8 internally Which me
by needusername 8y ago
> Java ... They all use 2 byte encodings
No, not anything that is OpenJDK 9+ based which uses 1 byte where possible.
> They all use UTF-8 internally
Which means a lot of functions now have linear instead of constant asymptotic complexity.
- masklinn 8y ago> Which means a lot of functions now have linear instead of constant asymptotic complexity. They already do if they do proper text manipulation as unicode itself is variable length and has to be stream-processed. O(1) access to codepoints is not actually useful, and most languages don't even provide it since they don't internally encode to UTF-32.