Skip to content
This repository has been archived by the owner on Feb 28, 2022. It is now read-only.

Move image loading for Patterns out of constuctor and into find code #541

Closed
mwobensmith opened this issue Aug 20, 2019 · 4 comments
Closed
Assignees

Comments

@mwobensmith
Copy link
Contributor

mwobensmith commented Aug 20, 2019

When one creates a Pattern via its constructor, we immediately look for the image in a number of reserved locations to establish the correct file path. This is good for enforcing error-checking in code, but has the side effect of a large startup time when you have lots of code that creates new Patterns, e.g. the Firefox target.

I'd like to explore a different approach where we don't do the image lookup until a find-related method has been called. The advantage is that we spread the wait time over the entire run and have an instant startup. One disadvantage might be that any attempts to query a Pattern's properties before this find call would result in some type of error. That might not be an issue, but we can find out by trying.

@mwobensmith
Copy link
Contributor Author

See also #174

@tracywalker
Copy link
Collaborator

Perhaps put into place yet another flag? A flag that can allow you to turn on/off pattern error finding at startup.

@mwobensmith
Copy link
Contributor Author

@tracywalker That is a consideration. I guess the first thing to do is see if it's even practical. Not sure if it's something localized - and easy to put behind a flag - or something that will require deeper code changes that would result in an all-or-nothing solution.

@mwobensmith
Copy link
Contributor Author

Fixed and merged with package work.

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

No branches or pull requests

2 participants