I am making a game in Java. The game is seperated into three threads at the moment (A spawner thread, an update thread, and a draw thread) The spawner spawns an enemy that moves towards the player. After about 800 spawn, the game starts to lag (Which is understandable somewhat). The question is should I create seperate threads for each Ai or should I update them all at once in an update Thread (which is the current case). Which one would produce the better performance?
I suggest you have less critical threads than you have CPUS. If you have 800 CPUs, go for lots of threads. If not, I would expect a much smaller pool of threads would be faster.
How much CPU and memory profiling have you done? You can achieve much greater speed ups with performance profiling than you can achieve my using multiple threads.