Skip to content

Create two (not three) WebGL contexts for scattergl/splom graphs #2662

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

Merged
merged 3 commits into from
May 24, 2018

Conversation

etpinard
Copy link
Contributor

As described in #2614, starting in version 1.36.0 all regl based graphs created 3 WebGL contexts (one for each canvas layer). But one of these layer (the pick layer) is only used in parcoords traces, so we can create two contexts instead of three on scattergl and splom graphs.

Why did this happen? I got sloppy in commit 469e4cd where I failed to bring this d.pick check into prepareRegl.

Reducing the number of WebGL context created does two things:

  • allows more scattergl/splom graphs to be displayed on a given page before hitting the browsers' WebGL context limit (= 16 on recent Chrome versions)
  • speed up first render benchmarks by ~40ms, which is significant (> 15%) on graphs with 1e5 points or less.

cc @alexcjohnson @dy

etpinard added 2 commits May 24, 2018 11:39
- so that we create two (not three) contexts in scattergl graph
  as we in versions before 1.36.0
@etpinard etpinard added bug something broken status: reviewable labels May 24, 2018
.then(done);
});

it('should create two WebGL context per graph', function(done) {
Copy link
Collaborator

Choose a reason for hiding this comment

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

contexts

Copy link
Contributor Author

Choose a reason for hiding this comment

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

done -> a3dce12

@alexcjohnson
Copy link
Collaborator

Nice, glad it was that easy! 💃

@etpinard etpinard merged commit 887cae6 into master May 24, 2018
@etpinard etpinard deleted the scattergl-two-not-three-contexts branch May 24, 2018 17:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug something broken
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants