My current JavaScript simulation runs a thousand games smoothly, but when scaled to 100,000 games, it crashes—10,000-game runs even trigger a wait dialog. What alternative approach might work?
js might not be the best for huge sims. try pythn, or use server side solutions to chunk out tasks. that should help avoid browser hang ups and crashes.
In my experience, while JavaScript can handle simulations fairly well on a smaller scale, issues start emerging when the load significantly increases. Using asynchronous techniques like web workers might help mitigate UI blocking, but managing state across repeated game runs could still prove challenging. Switching to a language like Python not only provides better memory management but also offers a variety of libraries designed for high performance simulations. Besides, you might consider running the simulation on a server environment to reduce browser-related constraints.