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

Stop button does not work if "Time per Frame" is set too low #5

Closed
gocursor opened this issue Apr 22, 2021 · 13 comments
Closed

Stop button does not work if "Time per Frame" is set too low #5

gocursor opened this issue Apr 22, 2021 · 13 comments

Comments

@gocursor
Copy link

If you set "Time per Frame" to 10 or 25 and start with triangulation you are not able to stop it with the "Stop" button, because it does not react. When "Time per Frame" is set to 250 the "Stop" button works as intended.

@rh12503
Copy link
Owner

rh12503 commented Apr 22, 2021

Thanks for opening this!

What OS are you running the app on? When the time per frame is set really low the application runs slower (as it needs to render more), but it still eventually stops. If you set the threads option to something low does it fix it?

@gocursor
Copy link
Author

I am running on Windows 10. I set the "Time per Frame" to 10 and "Threads" to 2 and the "Stop" button is still not working. But if I leave the default settings ("Time per Frame" set to 250) and set the "Points" to 1500 I also can not stop the rendering with the "Stop" button (I have to kill the app and start again).

@rh12503
Copy link
Owner

rh12503 commented Apr 22, 2021

I think the issue is that the algorithm is using 100% of your CPU, so the app is unresponsive to your input. I'm not sure what the best way to fix that would be, but I'll see what I can do.

Out of curiosity, what CPU model or how many cores do you have? I feel this issue may be more prevalent on slower systems. Also, is the rest of the GUI frozen when the stop button doesn't work?

@gocursor
Copy link
Author

Tested on CPU model i7-8650U, 4 cores, 8 threads.
Maybe it is just my wrong understanding what "Time per Frame" does... When I set "Time per Frame" to 1000 or 2000 I can stop everything - even when "Points" are set to 1500... So what exactly is "Time per Frame"?

@rh12503
Copy link
Owner

rh12503 commented Apr 22, 2021

Time per frame is the length of time between each frame rendered in milliseconds. For example, if the time per frame is 1000, a frame will be rendered every second.

@forgotPassword
Copy link

Great project! Having a similar issue, using a single thread with 3000 points, blocks the ui.

@rh12503
Copy link
Owner

rh12503 commented Apr 22, 2021

That's interesting. I tested it out on a Windows laptop, and I can confirm that it is an issue. I'm going to open an issue in Wails and see if there's a fix.

@rh12503
Copy link
Owner

rh12503 commented Apr 24, 2021

Turns out the issue was SVG rendering on ie11 is very slow - I'm going to switch to canvas instead.

@rh12503
Copy link
Owner

rh12503 commented Apr 24, 2021

Just published a new release - it seems to be working faster for me now. Does this fix your issue?

@plynml-c
Copy link

plynml-c commented Apr 24, 2021

It fixed it for higher points (3,000+ depending on CPU I'm guessing); I can now stop rendering for 3,000 points where it couldn't before.

However, if I try 10,000 points, it will still lag out / be unresponsive to stopping.

i5-7300
32 GB ram
Windows 10, using Triangula.exe
Threads = 0
All default settings, except 10,000 points

Don't know if that's beyond use case but it might be helpful to mention.

@rh12503
Copy link
Owner

rh12503 commented Apr 25, 2021

10,000 points will produce around 20,000 triangles, which is a lot for an HTML canvas. If you set the time per frame to 2500 or even 10000 does it work better?

@rh12503
Copy link
Owner

rh12503 commented Apr 25, 2021

10,000 points is beyond Triangula's intended use case, so I'm going to close this for now. It's unfortunate that this issue only affects Windows, but that will hopefully change with Wails v2.

The CLI still works fine with any number of points, so consider using that instead. I'm sure many others have had this issue, so thanks for bringing it up!

@plynml-c
Copy link

plynml-c commented Apr 28, 2021

10,000 points will produce around 20,000 triangles, which is a lot for an HTML canvas. If you set the time per frame to 2500 or even 10000 does it work better?

Yes -- setting Time per Frame to 2500 makes it run 10000 points much faster. GUI is slightly laggy but can stop no problem now. I understand now, I thought Time Per Frame was how long it would give the program time to simulate the triangle fitting and would affect accuracy, but now I understand that's just time to draw updates on the screen.

Bottom line, End User Error I suppose :)

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

4 participants