Performance (Repeat)

Please post any questions about developing your plugin here. Please use the search function before posting!
Senior Member
Posts: 324
Joined: Sat Oct 10, 2015 10:37 am
Location: Germany

Performance (Repeat)

Postby decompile » Tue Feb 21, 2017 2:47 am

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"?
User avatar
Project Leader
Posts: 1026
Joined: Sat Jul 14, 2012 9:29 pm
Location: Québec

Re: Performance (Repeat)

Postby L'In20Cible » Tue Feb 21, 2017 3:17 am

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.

Return to “Plugin Development Support”

Who is online

Users browsing this forum: No registered users and 3 guests