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

Faster Screenshot #957

Merged
merged 3 commits into from
Oct 22, 2020
Merged

Faster Screenshot #957

merged 3 commits into from
Oct 22, 2020

Conversation

akaszynski
Copy link
Member

@akaszynski akaszynski commented Oct 20, 2020

Overview

Simple fix to speedup screenshots (at least on Linux). Discovered this while working on potentially automating tests using screenshots.

Details

Here's the screenshot speed on Linux and Windows

import pyvista as pv

plotter = pv.Plotter(off_screen=True)
plotter.add_mesh(pv.Sphere(), smooth_shading=True)
timeit plotter.screenshot('/tmp/tmp.png')

feat/faster_screenshot (this branch)

# LINUX:   70.9 ms ± 212 µs per loop (mean ± std. dev. of 7 runs, 10 loops each)
# WINDOWS: 70 ms ± 145 µs per loop (mean ± std. dev. of 7 runs, 10 loops each)

master

# LINUX:   324 ms ± 564 µs per loop (mean ± std. dev. of 7 runs, 1 loop each)
# WINDOWS: 312 ms ± 462 µs per loop (mean ± std. dev. of 7 runs, 1 loop each)

MISC

I've also made a minor change in the tests to make sure we test all file types.

@codecov
Copy link

codecov bot commented Oct 20, 2020

Codecov Report

Merging #957 into master will increase coverage by 0.01%.
The diff coverage is 100.00%.

@@            Coverage Diff             @@
##           master     #957      +/-   ##
==========================================
+ Coverage   86.97%   86.98%   +0.01%     
==========================================
  Files          36       36              
  Lines        9060     9062       +2     
==========================================
+ Hits         7880     7883       +3     
+ Misses       1180     1179       -1     

@akaszynski
Copy link
Member Author

@pyvista/developers, ready for review.

@akaszynski akaszynski merged commit d9b7cb5 into master Oct 22, 2020
@akaszynski akaszynski mentioned this pull request Nov 8, 2020
@akaszynski akaszynski deleted the feat/faster_screenshot branch November 10, 2020 19:53
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.

None yet

2 participants