- Edited
First oddity, is there a reason that Godot wouldn't use at least 100% on one CPU core when I'm thrashing CPU based functions to the point that script lag is dropping my FPS to sub 45? In fact, it has a tendency to use ~13% total, but never fully utilises a single core.
While:
Second possibly obvious misunderstanding of 'Thread's in Godot, do these actually function in parallel at all when called in Process() or Physics_Process()? I have been doing some testing breaking up a function that iterates an array to perform calculations that normally takes 10ms. I split the array into 4 batches across 4 threads and for the purpose of testing, made 4 versions of the function (so they would show separately in the profiler), as far as I can tell it has the exact same performance as if I were to run them sequentially. Even in the profiler, each function shows up individually as taking almost exactly 2.5ms (not convinced the profiler accounts for thread times in this scenario though).
I also tried calling thread_n.wait_to_finish() across multiple frames
I tried toggling from single-safe to multi-threaded in project settings and this too seems to have no impact. I am just a little confused as to how I would go about optimising this task. I know in principle the above should work as I do similar in Python on the reg.