-
Notifications
You must be signed in to change notification settings - Fork 160
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Engine: speed up String.Chars[] iteration in unicode mode
This speeds up utf-8 string iteration by remembering last requested char index and buffer offset. This seems to be the only solution in the absence of proper ScriptString iterators in script API. Costs 4 extra bytes per managed String object. I intentionally limit these 2 indexes to uint16_t (64k char/byte) to save bit of mem. On average Strings are not that long, in the worst case things may be sped up by splitting into substrings in the script. This change does not impose any dependencies, does not change save format, and may be safely reverted anytime.
- Loading branch information
1 parent
e2beb30
commit 2b42ffd
Showing
3 changed files
with
22 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters