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

Direct code point tests? #5

Open
bathos opened this issue Dec 23, 2019 · 1 comment
Open

Direct code point tests? #5

bathos opened this issue Dec 23, 2019 · 1 comment

Comments

@bathos
Copy link

bathos commented Dec 23, 2019

Perf-sensitive lexing/parsing in ES often operates over code points represented as integers rather than strings. Currently, if we want to test whether a code point is a member of some Unicode property set, we have to do String.fromCodePoint(cp) and eval a regexp (assuming it isn’t practical to embed the property data), and it’s a slow path thing. This proposal should improve perf in such cases, but it appears we’ll still be left with the need to convert numeric code points to strings before we can check their membership.

I’d be curious to know if an API like String.getUnicodePropertyOfCodePoint() has been considered, and whether this seems valuable to others. That is, in addition to the API proposed here currently, not instead of it.

@srl295
Copy link
Owner

srl295 commented Jan 9, 2020

Perf-sensitive lexing/parsing in ES

Hi! Can you help me make the case in #3 for why this even belongs in ES? (see the other issue)

I’d be curious to know if an API like String.getUnicodePropertyOfCodePoint() has been considered, and whether this seems valuable to others. That is, in addition to the API proposed here currently, not instead of it.

It makes a lot of sense. As you said, in addition, not instead. It could similarly take an array of codepoints (see #1 )

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

No branches or pull requests

2 participants