Skip to content
This repository has been archived by the owner on Jun 11, 2024. It is now read-only.

Find a faster way to get snapshots #62

Closed
lencioni opened this issue Oct 31, 2015 · 3 comments
Closed

Find a faster way to get snapshots #62

lencioni opened this issue Oct 31, 2015 · 3 comments

Comments

@lencioni
Copy link
Contributor

In observing a lot of diffux runs, I noticed that the slowest examples are the ones with the largest viewports. I believe that we are spending a good chunk of time taking a screenshot of the whole page and then cropping it down to the element with ChunkyPNG. Although we've made some progress on cropping performance recently, I think there is more that we can do. Namely, I think our runs would be faster and consume less memory if we took a screenshot of just the element instead of the whole page and then cropping it down.

As far as I know, webdriver doesn't currently provide an API to take a screenshot of just a portion of a page. Figuring out how to do this might require adding a feature to webdriver or perhaps monkeypatching it somehow.

Since our runs are already pretty fast, I don't see this as a high priority at the moment, but I figured I'd document it here for when the time comes or if someone wants to pitch in.

@trotzig
Copy link
Contributor

trotzig commented Dec 4, 2015

Maybe we should make a commit that updates the README with a section on performance, and then close this issue? We can mention

  • using smaller viewports if large ones aren't needed
  • avoid doing screenshotEntireScreen unless it's really needed
  • avoid testing large components (break into smaller components instead)

@lencioni
Copy link
Contributor Author

lencioni commented Dec 8, 2015

I think that documenting those things is a good idea. My intention with opening this issue was to record what I think we can do to make runs generally faster for everyone and I think it still applies, however I'm okay with closing this issue out.

@lencioni
Copy link
Contributor Author

I think we can call this resolved with the release of Happo 4.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

2 participants