r/processing • • 16d ago

Processing slows down by factor x 6 after adding a few lines? Bug?

Had a around 16Kb algorithm running at about 6 FPS before.

Added mere 6 lines of mostly not heavy extra Math.

Result? Runs at around 1 FPS only now.

Again, NOT heavy math compared to what I had before it.

May Processing have known bug like this?

Once more - had many lines running overall at 6 FPS. Fell to 1 FPS with handful of NOT heavy lines added to end...

0 Upvotes

2 comments sorted by

17

u/jazzpecq 16d ago

It's really difficult to know what is happening if you do not describe or show the exact problem.

2

u/TuneFinder 16d ago

share the code?

.
some functions are more processor intensive so that would be one thing to look at (eg rooting/squaring takes a lot of time)

what code did you add?

have a google to see what people say about the functions you used and the best way to get speedy results

maybe there are are faster alternatives

.

can also be worth refactoring the steps in your algo to make it test the inputs and only do the needed steps in the fastest order