-1

I'm using the minecraft Spigot API and you can store information in a config.yml file and retrieve it with plugin#getConfig().

I need to get a string from the config every second. The string will remain the same for about 5 minutes before changing to a new string (this update is caused by a difference process).

I am wondering whether it would be more efficient to store this string locally whenever it changes and do what I need to do with the local variable.

Would I be making a significant difference in performance by doing it this way, I'm trying to optimize my code but if it's going to be a microsecond of difference I don't think its necessary.

oopsie
  • 29
  • 2

1 Answers1

1

File I/O will cost you significantly more than microseconds. Definitely cache the value and poll only as often as necessary.

OhleC
  • 2,821
  • 16
  • 29