cometkim / unicode-segmenter

A lightweight and fast, pure JavaScript library for Unicode segmentation
MIT License
37 stars 0 forks source link

Benchmark for React Native (Hermes) target #47

Closed cometkim closed 2 weeks ago

cometkim commented 2 weeks ago

Resolves #46

This utilizes perf benchmark bundling to React Native (hermes) target using its default configuration.

Size of the bytecode outputs:

Then execute the Hermes bytecode to measure perf of graphemer vs unicode-segmenter/grapheme.

The result on my MacBook Pro M1 laptop:

graphemer (small input)
samples: 1000
duration (avg): 0.326

graphemer (medium input)
samples: 1000
duration (avg): 1.611

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

unicode-segmenter/grapheme (medium input)
samples: 1000
medium input (avg): 0.674
changeset-bot[bot] commented 2 weeks ago

⚠️ No Changeset found

Latest commit: db79d827575313b18328ab041b03d88b02314500

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

codecov[bot] commented 2 weeks ago

Codecov Report

All modified and coverable lines are covered by tests :white_check_mark:

Project coverage is 100.00%. Comparing base (6d02503) to head (db79d82).

Additional details and impacted files ```diff @@ Coverage Diff @@ ## main #47 +/- ## ========================================= Coverage 100.00% 100.00% ========================================= Files 18 18 Lines 2765 2765 ========================================= Hits 2765 2765 ```

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.