Question on stress testing a projectile/particle system in general

I’m working on a “particle / projectile” module for my game. What am I supposed to look for when stress testing?

  1. how many projectiles it can render simultaneously each frame without lag
  2. how many projectiles it can spawn per frame without lag
  3. how many total projectiles in can simultaneously render through the course of 1 second
  4. any other thing some1 can think of

i was testing it earlier, and I was doing projectile.new() 100 times each frame (RenderStepped).
it lagged super bad, and I was super confused until I realized I was trying to spawn well, 100 projectiles each frame, which is, as far as I know, super unlikely to happen. My question how should I stress test this?

Sorry I can’t really go into much detail as I’m on mobile right now, but you could do this to test the amount of time taken to create a million projectiles:

local start= tick()

for i=1,1000000 do
	--Projectile code
end

print(tick() - start - 0.2)--Subtract 0.2 because of the loop.

yea I was thinking of that for testing spawn rates but the performance heavy part is updating the projectiles.

when a projectile is created by projectile.new, it is inserted into a table called “projectiles”
every renderstep, projectiles is looped through and each projectile has its update method called.

actually i seem to be handling around 600 projectiles updating per FRAME without any noticable lag
idk if this is good or not, any1 know?

increased how many projectiles r spawned each second to the point theres 1k projectiles being updated every frame depending on how far theyre going. theres a noticeable lag but its very minimal. once again still dont know if its good or not tho

Well, it depends. If players can shoot with no delay, then you might want to test more. However, if there is a delay then you will most likely be fine.