@Simon: you can also run the for loop in nearest_part with multiple threads. doing a quick check with openmp (I don't know pthreads myself) it is a stable change.
That's sounds like a bad idea, when there is a simpler and more efficient solution.
And besides, some computers don't have several threads.
The game already uses pthreads and detects the number of threads it can use on your system (if you don't have the ability it just does 1 thread), it is used for drawing the particles if i'm not mistaken, as proof the task manager shows ptp.exe is using 3 threads on my computer.
It also speeds up the other "simpler" speedups (which actually are as complex as adding more threads for the loop, not as hard as it sounds comparatively)
The game already uses pthreads and detects the number of threads it can use on your system (if you don't have the ability it just does 1 thread), it is used for drawing the particles if i'm not mistaken, as proof the task manager shows ptp.exe is using 3 threads on my computer.
It also speeds up the other "simpler" speedups (which actually are as complex as adding more threads for the loop, not as hard as it sounds comparatively)
I already know that, but it is just sidestepping the problem by using a bit more computer power. Which is never good because that power might be needed for other things in powder toy to become multi threaded. And as I said, for single-threaded processors. There would be no speedup.
But there is nothing saying that you can't do all 3, you can still do the other 2 and still have the multi-threading for those who can use it (if 50% can use it why not have it? Otherwise your saying remove the multi-threaded rendering because not everyone can use it).
But there is nothing saying that you can't do all 3, you can still do the other 2 and still have the multi-threading for those who can use it (if 50% can use it why not have it? Otherwise your saying remove the multi-threaded rendering because not everyone can use it).
I am not, I am just saying that "solving" it with multi threading is not solving it.
Stop generalizing what I say towards other cases, please. Both you and I know the multi threaded rendering is a smart way to render stuff quicker on the screen. Provided that there are more than one thread, but if there are there will be a speed increase.
Well I don't mean to offend you of course but I also don't understand why you are disagreeing then I mean, I came up with the other 2 ways to optimize it and you supported them then when I reported that I also had a speedup using multi-threading you said it wasn't a good idea. I understand throwing more cycles at a bad algorithm isn't fixing it but I also suggested modifying the algorithms and now I'm saying make the modifications multi-threaded.
It does not matter if it lags, because it does say to use it sparingly. I'm not stupid enough to use s**t loads of it. Just use a little bit and you'll be fine.
Well I don't mean to offend you of course but I also don't understand why you are disagreeing then I mean, I came up with the other 2 ways to optimize it and you supported them then when I reported that I also had a speedup using multi-threading you said it wasn't a good idea. I understand throwing more cycles at a bad algorithm isn't fixing it but I also suggested modifying the algorithms and now I'm saying make the modifications multi-threaded.
(edited for clarity)
Sure, but from what you wrote I thought you meant only throw some more threads at it, not combining all of the methods.
Andrewrox:
It does not matter if it lags, because it does say to use it sparingly. I'm not stupid enough to use s**t loads of it. Just use a little bit and you'll be fine.
Even if you use little it has a big performance inpact, since it has to scan through all other particles. And besides, only four particles of it has a huge impact in bigger creations.
I greatly like ssc4k's idea. Not only would it speed it up but also would add a bit of realism since plasma arcs in real life really do become more imprecise the further away the electrodes are which, looking at his solution, appears as though it would be a side effect of the speed-up. Whoohoo! Electrode/plasma speed-up and added arc realism! I'm all for it!