asweigart / pyscreeze

PyScreeze is a simple, cross-platform screenshot module for Python 2 and 3.
BSD 3-Clause "New" or "Revised" License
194 stars 96 forks source link

Store needle length #52

Open snoyes opened 5 years ago

snoyes commented 5 years ago

Profiling a full screen search shows that calling len(needle) repeatedly adds nearly a second to the run time.

snoyes commented 3 years ago

The same should be done in _steppingFind - len(needle) is called repeatedly in a loop.

Do you think that's why no performance gain was noted and so the step size was hardcoded to 1, hence _steppingFind is never used?

https://github.com/asweigart/pyscreeze/blob/3fddc81d4e2cf99a2c1168ee2a1e96771c5f8805/pyscreeze/__init__.py#L286-L295

Avasam commented 3 months ago

@snoyes This now has conflicts