Page 1 of 1

Performance (Repeat)

Posted: Tue Feb 21, 2017 2:47 am
by decompile
Hey Guys,

Im currently kinda rewriting my own plugin and Im actually wondering if theres any problem with using every 0.1 seconds Player.observer_target for each player for my spectator list plugin, or should I rather cache it by checking every players "spec_next" "spec_previous"?

Re: Performance (Repeat)

Posted: Tue Feb 21, 2017 3:17 am
by L'In20Cible
Depend of your implementation. If you loop through all players creating new instances (via PlayerIter, for example), then yes, it can be very slow. On the other hand, if you cache the instances (using PlayerDictionary, for example) then you can gain performance. However, performance should be considered once it becomes an issue.