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

Executing library benchmark: unicode-segmenter #210

Open
cometkim opened this issue Nov 12, 2024 · 0 comments
Open

Executing library benchmark: unicode-segmenter #210

cometkim opened this issue Nov 12, 2024 · 0 comments

Comments

@cometkim
Copy link

cometkim commented Nov 12, 2024

Hey, I tried to compile and execute my library unicode-semgneter which is pure JS alternative to Intl.Segmenter API

You can fine the case here: cometkim/unicode-segmenter#61

It compiles and executes well. But the printed output looks like a false positive results:

❯ yarn porf benchmark/porffor/run.out.js

unicode-segmenter/grapheme (small input)
samples: 1000
duration (avg): 0.789

unicode-segmenter/grapheme (medium input)
samples: 1000
duration (avg): 0.793

Here is the result on Hermes for the comparison:

unicode-segmenter/grapheme (small input)
samples: 1000
duration (avg): 0.195

unicode-segmenter/grapheme (medium input)
samples: 1000
medium input (avg): 0.699

And even stranger, if I increase the value of samples 2x (:%s/1e3/2e3/g), the bench emits undefined values.

unicode-segmenter/grapheme (small input)
samples: 2000
duration (avg): 0.7715

unicode-segmenter/grapheme (medium input)
samples: undefined
duration (avg): undefined

And if I increase the number even more, like to 5000, it's takes very very long time and print something like this

unicode-segmenter/grapheme (small input)


0 0 2 undefined   undefined  {} undefined 0 0 2 undefined   undefined  {} undefined undefined undefined undefined undefined undefined
unicode-segmenter/grapheme (medium input)

(exited 0)

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

1 participant