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

Make benchmarks navigable and add fps tests for setData #2327

Merged
merged 2 commits into from
Mar 31, 2016

Conversation

mcwhittemore
Copy link
Contributor

@lucaswoj & @ansis here is a benchmark showing fps degrading as the zoom level approaches 22 when setting data on a geojson source.

Would love feedback on how to make this better judge performance. FPS doesn't capture what is rendered on the canvas that well for instance.

@mcwhittemore mcwhittemore changed the title [WIP] benchmark for rendering geojson data at zoom levels Benchmark for rendering geojson data at zoom levels Mar 28, 2016
@mcwhittemore
Copy link
Contributor Author

Is this good to merge?

@lucaswoj
Copy link
Contributor

Not yet. I'll give this a review later today.

map.addLayer({
'source': 'geojson',
'id': 'geojson-polygon-fill'
type: 'fill',
Copy link
Contributor

Choose a reason for hiding this comment

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

There is a syntax error here (no , after 'id': 'geojson-polygon-fill').

My apologies, I broke the linter in #2314 and fixed in #2347. Can you rebase on master and fix the lint errors?

@lucaswoj
Copy link
Contributor

Do you think we could generalize our existing fps benchmark to capture this perf regression? (i.e. by measuring FPS over the set of tiles specified in coords.js)

Having fewer & robuster benchmarks will help us find future performance regressions.

@mcwhittemore mcwhittemore force-pushed the bench-geojson-rendering branch 2 times, most recently from 5fb0698 to e2c2dd2 Compare March 28, 2016 21:07
@mcwhittemore mcwhittemore changed the title Benchmark for rendering geojson data at zoom levels Make benchmarks navigable Mar 28, 2016
@mcwhittemore
Copy link
Contributor Author

@lucaswoj - Looking into this more, what I had feels a bit past contrived. Limiting this PR to a simple restructuring of the benchmarks as I look into this some more.

@mcwhittemore mcwhittemore force-pushed the bench-geojson-rendering branch 2 times, most recently from d6e1028 to 27b199e Compare March 29, 2016 22:08
@mcwhittemore mcwhittemore changed the title Make benchmarks navigable Make benchmarks navigable and add fps tests for setData Mar 29, 2016
@mcwhittemore
Copy link
Contributor Author

This adds to setData tests to the fps bench as well per chat. One for a large feature collection, for a small feature collection.

@mourner or @lucaswoj for the review

};

map.repaint = true;
measureFramerate(DURATION_MILLISECONDS, function(err, fps) {
Copy link
Contributor

Choose a reason for hiding this comment

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

Why did you choose fps to measure setData performance? Can we measure tile creation time directly?

Copy link
Contributor

Choose a reason for hiding this comment

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

Ah! I just saw where you wrote:

This adds to setData tests to the fps bench as well per chat. One for a large feature collection, for a small feature collection.

So sorry for misspeaking. I didn't mean to imply that we should test setData within the FPS benchmark. These should be two separate benchmarks.

  • the fps benchmark tests the fps across a variety of streets-v8 viewports (i.e. those in coords.js)
  • the set-data benchmark tests the time from a GeoJSONSource#setData call to the data being rendered on screen for different sized GeoJSONs

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Cool. Breaking these up. I put them together as seeing the normal fps was helpful, but I agree this limits the FPS benchmark from getter better.

@mcwhittemore
Copy link
Contributor Author

@lucaswoj - updated the PR to break setData and FPS apart. Also changed setData to track the average time it takes to load all the tiles after a setData. This should be a better metric for setData perf than fps, though time to load tiles could go down and fps be negatively impacted.

I don't think we want to break this test into two files per: Having fewer & robuster benchmarks will help us find future performance regressions So I'm using two ends which feels dirty. To be honest, I think we should worry about the best way to do this kind of tracking when we're writing the automation benchmark code. Right now we're trying to find what is best for our own usage. We can confirm automation to that.

@lucaswoj
Copy link
Contributor

Having two scores in this benchmark is a non-starter for me. Breaking this up is very easy. You are measuring two separate things.

@mcwhittemore mcwhittemore force-pushed the bench-geojson-rendering branch 2 times, most recently from 500b70c to dd3b349 Compare March 30, 2016 18:02
@mcwhittemore
Copy link
Contributor Author

@lucaswoj updated to be two tests.

@lucaswoj
Copy link
Contributor

Looks good 🚢

@mcwhittemore mcwhittemore merged commit 3f86fbf into master Mar 31, 2016
@mcwhittemore mcwhittemore deleted the bench-geojson-rendering branch March 31, 2016 15:57
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.

3 participants