View Single Post
Old 02-16-2012, 09:34 AM   #8
Kitriel
New Member
 
Join Date: Jul 2010
Posts: 10
Kitriel is on a distinguished road
Re: High volume scripting question

Camlorn, thanks for that suggestion. Caching the bytecode instead of using lua_dofile decreased script run time from ~0.005sec per script to ~0.0005 to ~0.001sec per script. Not exactly where I wanted it, but it's certainly faster this way. (Ideally, I want it to be able to run 10k scripts without having any lag at all ... maybe that's wishful thinking :P)

In addition to the above, I also added an 'active' system to areas. If a player is not in an area for over 5min, it becomes inactive (thus suspending all scripting action in the area). This, coupled with the 50 script throttle (only 50 scripts can be executed in one sitting), the lag is basically non-existant now. But, the potential for script delay is still there and i'll continue to work on this. (if there's 25000 scripts and only 50 get cycled through every 0.01sec, the last scripts would be way longer than 1sec intervals).

If anyone has any other suggestions or ideas, feel free to post. And thank you to everyone that has posted ideas and what not.

-Kitriel
Kitriel is offline   Reply With Quote