Memory VS CPU usage
Let's say I'm making a plugin that would use 14 different kind of motds. So which is the best way?
1# Make a 14 times 2536 array and make the motds once. 2# Always when a player wants to see one motd, do it and destroy the variable. The motds are showed as often as you would watch /rankstats. Also note that when making a motd the plugin reads throw all players' datas from a file. So I need your opinions. |
Re: Memory VS CPU usage
Quote:
|
Re: Memory VS CPU usage
if you choose option #2 and 2 players try to open different MOTDS at the same time, your server might kerplode (joke. but i dunno what would happen)
i personally would go for #1 |
Re: Memory VS CPU usage
Quote:
Quote:
|
Re: Memory VS CPU usage
I think one double array would be good. I would go for #2.
motd[id][...]. I bet there is another way that is better |
Re: Memory VS CPU usage
Quote:
You can read all the data to memory on map start. You can read, on each player first join, his data and keep it in memory. You can read the needed player data when the command is issued. Still, I can be wrong because "some kind of top" is too vague |
Re: Memory VS CPU usage
Ye, your 2nd isn't possible, since the top is from all players ever played on the server, not just players who played the current map. Like I already said you could compare this to "/top15" command.
|
Re: Memory VS CPU usage
Quote:
|
Re: Memory VS CPU usage
Quote:
|
Re: Memory VS CPU usage
Quote:
|
| All times are GMT -4. The time now is 18:27. |
Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.