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

[FEATURE] Early-termination while processing contentstream #190

Closed
gunnsth opened this issue Oct 21, 2019 · 2 comments
Closed

[FEATURE] Early-termination while processing contentstream #190

gunnsth opened this issue Oct 21, 2019 · 2 comments
Labels
feature New feature good first issue Good for newcomers performance

Comments

@gunnsth
Copy link
Contributor

gunnsth commented Oct 21, 2019

Is your feature request related to a problem? Please describe.
The problem is inefficiency when simply looking for a single operand and then stopping processing.
For example, if only looking for a single colored pixel in a page.

Describe the solution you'd like
It would make sense to be able to set a stop flag on the processor and return out of the handler, which would cause the processor to return out without further processing.

Describe alternatives you've considered
An alternative implementation using channels has been done by a collaborator.
https://github.com/peterwilliams97/unipdf/blob/early.termination/contentstream/parser.go
https://github.com/peterwilliams97/unidoc-examples/blob/imagemark.classify/testing/pdf_count_color_pages_bench.go

If the simple stop flag would be enough to get this done, I believe it would be more simple method.

Additional context
N/A

@gunnsth gunnsth added the good first issue Good for newcomers label Jun 24, 2020
@gunnsth
Copy link
Contributor Author

gunnsth commented Aug 6, 2024

@sampila Appears this is already implemented with ErrEarlyExit flag, right?

@sampila
Copy link
Collaborator

sampila commented Aug 6, 2024

@gunnsth yes, closing this issue

@sampila sampila closed this as completed Aug 6, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature New feature good first issue Good for newcomers performance
Projects
None yet
Development

No branches or pull requests

2 participants