24.08.2009, 17:51
Are dcmd and sscanf supposed to be just faster or faster and more cpu friendly?
The reason i ask is, i was using strtok for all of my commands.
I had problems with the CPU usage going upto 80% at times when there was around 30 players in.
There was a lot of loops, and dumb pieces of script i wrote a long time ago and forgot about. I fixed them, and removed most.
Everything seemed fine, CPU was around 30% with around 30-40 in. Still pretty high, but there were no restarts due to CPU protection.
Then i changed all my admin commands to dcmd and used sscanf with them. This was only for my admin commands and used sscanf for my IRC commands.
The weird thing is, its showing more CPU usage than with strtok. Theres nothing else i've added since removing a load of stuff, the only change was my admin and irc commands from strtok to dcmd and sscanf.
The reason i ask is, i was using strtok for all of my commands.
I had problems with the CPU usage going upto 80% at times when there was around 30 players in.
There was a lot of loops, and dumb pieces of script i wrote a long time ago and forgot about. I fixed them, and removed most.
Everything seemed fine, CPU was around 30% with around 30-40 in. Still pretty high, but there were no restarts due to CPU protection.
Then i changed all my admin commands to dcmd and used sscanf with them. This was only for my admin commands and used sscanf for my IRC commands.
The weird thing is, its showing more CPU usage than with strtok. Theres nothing else i've added since removing a load of stuff, the only change was my admin and irc commands from strtok to dcmd and sscanf.