View Single Post
Old 02-14-2012, 08:40 AM   #6
dentin
Member
 
Join Date: Apr 2008
Home MUD: Alter Aeon
Posts: 245
dentin is on a distinguished road
Re: High volume scripting question

Kitriel,

Instead of scheduling the events to happen one second from now, schedule them to happen at 1 second plus or minus 200 ms. This way your long term timing at once per second will be preserved, but after a very few iterations they'll be spread out all over the place instead of bunched up.

However, I think you've answered your original question: if the server and/or machine is becoming unplayable at a mere 250 scripts per second, then you simply cannot do high-volume scripting with the tools you've picked. Lua is powerful and convenient, but it's interpreted; it's not designed for speed or performance. If you really want to do high-volume work, you'll probably have to switch to a higher speed language like C.

Good luck!

-dentin

Alter Aeon MUD
dentin is offline   Reply With Quote