Skip to content

added benchmarks - #15

Merged
mfogel merged 5 commits into
mfogel:masterfrom
erf:bench
Apr 13, 2018
Merged

added benchmarks#15
mfogel merged 5 commits into
mfogel:masterfrom
erf:bench

Conversation

@erf

@erf erf commented Apr 2, 2018

Copy link
Copy Markdown
Contributor

I added the benchmarks from w8r repo plus your implementation. I suspect pointsAsObjects to lower the benchmarks, this could perhaps be done before running the tests.

@erf erf mentioned this pull request Apr 2, 2018
@coveralls

Copy link
Copy Markdown

Pull Request Test Coverage Report for Build 128

  • 0 of 0 (NaN%) changed or added relevant lines in 0 files are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage remained the same at 99.387%

Totals Coverage Status
Change from base Build 126: 0.0%
Covered Lines: 728
Relevant Lines: 729

💛 - Coveralls

@coveralls

coveralls commented Apr 2, 2018

Copy link
Copy Markdown

Pull Request Test Coverage Report for Build 133

  • 0 of 0 (NaN%) changed or added relevant lines in 0 files are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage remained the same at 99.387%

Totals Coverage Status
Change from base Build 126: 0.0%
Covered Lines: 728
Relevant Lines: 729

💛 - Coveralls

@mfogel

mfogel commented Apr 9, 2018

Copy link
Copy Markdown
Owner

Somehow I missed the notification for this. Thanks for the PR! I'll review it in the next few days.

@mfogel

mfogel commented Apr 10, 2018

Copy link
Copy Markdown
Owner

Ok, thanks for the PR. Looks good in general. I had two thoughts:

  • in wr8/martinez I believe it's set up so npm run bench works. Can that be set up to work here?

  • as far as directory structure, I'd rather keep the bench stuff a bit more self-contained. What do you think about:

    • polygon-clipping/bench/bench.js
    • polygon-clipping/bench/fixtures/

@erf

erf commented Apr 10, 2018

Copy link
Copy Markdown
Contributor Author

Does this look ok?

@mfogel mfogel left a comment

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Two typos and a higher-level require()

Comment thread bench/bench.js Outdated
asia.features[0].geometry.coordinates,
[unionPoly.geometry.coordinates]);
})
.add('w83', () => {

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

typo? 'w83' - > 'w8r'

Comment thread bench/bench.js Outdated
states.features[0].geometry.coordinates,
[states.features[1].geometry.coordinates]);
})
.add('w83', () => {

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

typo? 'w83' - > 'w8r'

Comment thread bench/bench.js Outdated
const Benchmark = require('benchmark');
const jstsUnion = require('@turf/union');
const w8r = require('martinez-polygon-clipping');
const mfogel = require('../src/index');

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think it would be better if the benchmark went through the api mentioned in the README - which is actually right now in main.js. So this would change to

const mfogel = require('../main');

Where mfogel is then used below in the benchmark suites, it would have the exact same form as w8r - ie mfogel.union(...) and the operation require on the next line would not be needed.

@mfogel

mfogel commented Apr 10, 2018

Copy link
Copy Markdown
Owner

Thanks for making the directory structure changes, I'll merge this in after the things mentioned in the review I just did are addressed.

@erf

erf commented Apr 11, 2018

Copy link
Copy Markdown
Contributor Author

Fixed - please let me know if there is anything else.

@rowanwins

Copy link
Copy Markdown
Contributor

My only other suggestion here which is super-minor is sometimes people dump the results of the benchmark at the top of the bench.js file so that it is easy to see current results without having to run the benchmark yourself. Obviously you take the results with a grain of salt because it'll depend on what computer they are run on etc, but it does allow a nice quick comprison.

@mfogel
mfogel merged commit 738f629 into mfogel:master Apr 13, 2018
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.

4 participants