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

Ported to ES6 #36

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open

Ported to ES6 #36

wants to merge 2 commits into from

Conversation

SKalt
Copy link

@SKalt SKalt commented Jul 21, 2019

I used rbush and flatbush as an example. I

  • adopted eslint with eslint-config-mourner
  • added rollup
  • swapped in let, const, and import
  • added a module field in package.json
  • added npm/yarn scripts: perf, pretest, test
Tests pass
eslint index.js test/test.js
tape -r esm test/test.js | faucet
# ✓ simplifies points correctly with the given tolerance
# ✓ just return the points if it has only one point
# ✓ just return the points if it has no points
# # tests 3
# # pass  3
# ✓ ok
# Done in 1.07s.
Performance comparison (no significant difference) All using node 12.
@v1.2.3
Setup script ```sh git checkout v1.2.3 ```
node ./bench/bench.js
# Benchmarking simplify on 1118 points...
# simplify (HQ) x 9,448 ops/sec ±1.99% (88 runs sampled)
# simplify x 15,110 ops/sec ±2.73% (88 runs sampled)
teardown script ```sh git checkout - ```
Using node + ESM
node -r esm bench/bench.js
# Benchmarking simplify on 1118 points...
# simplify (HQ) x 185 ops/sec ±2.86% (78 runs sampled)
# simplify x 2,144 ops/sec ±3.00% (85 runs sampled)
# Done in 11.14s.
Using current compiled UMD
Setup script
git checkout v1.2.3 -- bench/bench.js
node ./bench/bench.js
# Benchmarking simplify on 1118 points...
# simplify (HQ) x 9,339 ops/sec ±2.03% (90 runs sampled)
# simplify x 14,789 ops/sec ±2.50% (86 runs sampled)
teardown script ```sh git reset --hard ```

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

Successfully merging this pull request may close these issues.

1 participant