Context:
- My LibGDX based game engine "KZ2D".
- Hardware: PC MEmu 8-Core simulated tablet.
What was threaded:
- I paralleled the processing of two independent cycles of my game logic: Objects (coins, rockets, chests, etc) and AI Agents (enemy characters).
Variations:
- A: [Serial] default game cycle (first objects, then AI agents)
- B: [Parallel] LibGDX CallAsync
- C: [Parallel] ProBundle CallSubExtended
*All of the above were called from the LG_Render event.
Results:
- A: ~0.30 milliseconds total cycle time
- B: ~0.75 milliseconds total cycle time
- C: ~1.10 milliseconds total cycle time (with errors but no crashes)
Safety:
- LibGDX CallAsync was properly initialized and disposed outside the render event
- Do While TaskA.IsRunning OR TaskB.IsRunning : Loop
- Do Until TaskA.IsDone AND TaskB.IsDone : Loop
Conclusion:
- Serialized (single threaded) seems to be the fastest solution so far, but once I'm able to test on real hardware I'll come back with more results... Nonetheless, it doesn't make sense. Shouldn't parallel processing be faster?
- My LibGDX based game engine "KZ2D".
- Hardware: PC MEmu 8-Core simulated tablet.
What was threaded:
- I paralleled the processing of two independent cycles of my game logic: Objects (coins, rockets, chests, etc) and AI Agents (enemy characters).
Variations:
- A: [Serial] default game cycle (first objects, then AI agents)
- B: [Parallel] LibGDX CallAsync
- C: [Parallel] ProBundle CallSubExtended
*All of the above were called from the LG_Render event.
Results:
- A: ~0.30 milliseconds total cycle time
- B: ~0.75 milliseconds total cycle time
- C: ~1.10 milliseconds total cycle time (with errors but no crashes)
Safety:
- LibGDX CallAsync was properly initialized and disposed outside the render event
- Do While TaskA.IsRunning OR TaskB.IsRunning : Loop
- Do Until TaskA.IsDone AND TaskB.IsDone : Loop
Conclusion:
- Serialized (single threaded) seems to be the fastest solution so far, but once I'm able to test on real hardware I'll come back with more results... Nonetheless, it doesn't make sense. Shouldn't parallel processing be faster?