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

optimization for fromCharCode usage #35

Open
Clayblockunova opened this issue Jan 28, 2022 · 2 comments
Open

optimization for fromCharCode usage #35

Clayblockunova opened this issue Jan 28, 2022 · 2 comments

Comments

@Clayblockunova
Copy link
Contributor

Clayblockunova commented Jan 28, 2022

Currently, when fromCharCode or fromCodePoint is used, the whole string is converted into decimal codepoint even if the string begin or ended with simple characters (numbers, 'N','a','d','e','f','i','l','n','r','s','t','u'). Using "+" to attach those simple characters on head or end of string genetated by fromCharCode can shorten generated code.

@fasttime
Copy link
Owner

fasttime commented Jan 28, 2022

I think I understand what you mean, but could you please post an example here, just to be sure?

@Clayblockunova
Copy link
Contributor Author

Clayblockunova commented Jan 28, 2022

currently, "f中中" cost 5568 chars, but "f"+"中中" only cost 5237 chars.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants