Loading...
Logo
Processing Forum
Hi,

I have built a visualization which works fine when compiled from Processing IDE, but is extremely slow when in applet mode. It's got some controlP5 controls, and reads small data files from HDD. By slow I mean that animations are moving sort of by fits and starts, controls respond with a delay etc. Very uncomfortable and annoying feeling.

The thing is, that it's even slow when run in applet mode on my own computer.

Please let me know if anyone has experienced this before, and what the problem might be. Thank you so much!

Sergiy

Replies(5)

It's hard to idenitfy problems without seeing some code.  Maybe you could provide a link?

Still, a common and maybe relevant issue that causes slowdown is repeated loading of files within draw() - something that should be avoided wherever possible.  Also, remember that the applet is embedded in the browser and that's going to hog some resources and potentially slow things down a little; but my guess is that it's an issue with file operations...
Thank you for the response. It seems that browser matters as well. On my Mac, Safari handles processing Java applets much better than Chrome. There is still some slowdown, but it is sort of tolerable.

There is no repetitive loading files, but there are multiple things moving around (like ~80 circles and a bunch of lines), all multithreaded. Could that be slowing it down?

I will post code if necessary, it's just that it is fat (about 2500 lines of code, maybe more).

Thanks!
Multithreading can be an issue as well, I don't know if browsers can limit it in the applets they host.
If you want to publish a large sketch, you can do it in one of the numerous pastebin (google the term) clones on the Net.
Chrome (on the Mac at least) does have some pretty hefty problems with rendering Processing.

Also, although you probably already know this, with ControlP5 don't forget your public variables.
Hello everyone,

I realize that multithreading may be an issue, but rebuilding it would mean changing architecture and pretty much rewriting the whole thing :(

Safari handles the applet sort of ok, so I will keep working to put it online (other local to web transfer issues, a little annoying but oh well), and will post a link to it here once it is live.

Thank you so much for all the input and useful comments.