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

Convert gets called multiple times on slow devices #709

Open
Leone25 opened this issue Dec 25, 2023 · 0 comments
Open

Convert gets called multiple times on slow devices #709

Leone25 opened this issue Dec 25, 2023 · 0 comments

Comments

@Leone25
Copy link

Leone25 commented Dec 25, 2023

Hello,

On slow devices, such as raspberry pi 2 b+, since they are very limited resource wise, they tend to respond slowly to the preview request. What I've noticed from looking at processes trough htop (or top) while generating a preview of a scan is that the convert command gets called many times and multiple processes get started at the same time, all doing the same thing, aka converting and scaling down the preview image. Considering how slow the pi is, having to do this operation multiple times at the same time for no reason can be very degrading to the experience with the app.

I've checked a bit what the app is doing and I think there are multiple factors at blame:

  1. Refresing the preview image every flew seconds: I get why this is done, it allows the user to preview live the progress of the scan and it's an easy way to do pooling
  2. Not queueing requests: This tbh feels more like a design flaw/a cheap way to just get in working, what I believe it should happen is that requests to this endpoint should be queued, allowing, if the previews request hasn't finished processing in time for the next one, to all receive the same output from a single conversion process

By any chance, could we get a fix for this? I've tried to do this my self but, I'm not sure if my method would be the appreciated one. I'm willing to do it my self if you'd just give me some directives.
Perhaps it would also be a good idea to include a way to disable generating previews while the scanner is still scanning.
Lastly, why can't we delegate the resizing operation to the frontend?

Thank you for your time
Enrico

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

No branches or pull requests

1 participant