Separate refresh rates
JHarris12345 opened this issue ยท 10 comments
Description
I believe we should have a config option for all holograms called "refreshRate" (seconds) so we can control how often holograms refresh it is proving very laggy having them all on the defautl one. Maybe even better if we can add speed placeholders like {slow} etc before placeholders so we can control individual placeholders on the same holo
There will be a configurable refresh rate for PlaceholderAPI placeholders (a single settings for now, I prefer to keep it simple if possible). With regards to performance without PlaceholderAPI, I will optimize the plugin without requiring an additional setting if possible.
@filoghost Which branch can I fork to get the latest 3.0.0 jar because whenever I compile any of them the PAPI placeholders don't work. And I'd like to fork it just temporarily to slow down the refresh rate as refreshing some placeholders 20 times a second is dropping TPS to about 10.
OR is it possible for you to add a config option real quick for a global refresh rate just to we can at least set a refresh rate that works better for us?
Placeholder format has been changed to {papi: placeholder}. E.g.: {papi: player_name}. Will add a config option before the next beta release on Bukkit Dev.
@filoghost I did a small fork and changed the PlaceholderAPIPlaceholderFactory to this:
Which just lets you format placeholders like:
{papi: player_name:[refreshRate]} E.g {papi: player_name:20}
And that works nicely for setting a per-placeholder refresh rate
Perhaps this is a nice method to adopt for the actual update @filoghost ? Works really nice. There's 1 more method in the plugin that causes lag but nothing from placeholders now
I think there should be a default refresh rate for PlaceholderAPI's placeholders in the configuration. For individual refresh rates, it also could be better to specify them in the configuration, so you have only a single place to change the values. Having the same placeholder with different refresh rates would cause more refreshes.
But then youll only be able to have 1 refresh rate for an entire hologram. Which for a hologram like a stats board, you might want to some to update every second and others every 30 seconds.
Also I can confirm with my fork where you can set individual refresh rates per placeholder, there is 0 lag from placeholders or the holographic displays placeholder methods. If anything, having separate refresh rates per placeholder in a holo would SAVE lag because there will be holos where youll want some placeholders to update more often than others and that will cause lag for the ones you want to update slower. Also remember with my method, you dont NEED to set a refresh rate for every placeholder. If you dont set one, it simply uses the default (which i set to 10 seconds). At least this method gives the ability to really slow down placeholders you dont need to update that often
Also Im not sure what you mean by having the same placeholder with different refresh rates would cause more lag. In which scenario would you have more than 1 of the same placeholder on a holo? Also why would it cause anymore refresh rates than if you had the same placeholder on holograms that refresh at a set speed anyway
I'm sorry, as part of the switch to maintenance-only mode (read here for more info), I'm no longer adding new features or enhancements to the plugin.