uncovery / uncovery_me

Full source of the uncovery.me minecraft server
GNU General Public License v3.0
12 stars 3 forks source link

Speed up umc_plg_include() #281

Closed uncovery closed 6 years ago

uncovery commented 7 years ago

with 0.02 seconds, this function is one of the slowest we have. I strongly assume that this is because of the file read operation. It's also executed with every websend command.

We can either store the list of files somewhere or find another way to speed this up.

LukeBillington commented 7 years ago

I think making a file so you can register plugins might be more of an effective way of doing this, instead of scraping the folder, Also, not saying that this would be an issue, but if any feature ever is found buggy and needs to be temporarily disabled then having this would be as simple as commenting it out.

Would it also make sense to do some routing with an if statement on a command name? Then it would include only the files needed to run the command?

uncovery commented 7 years ago

The file is probably a good solution. At least I could build one once a day as a cache instead of re-reading it every time.

The disabling is already taken care of since there is a switch inside the plugin that allows that.

Not sure what you mean with the routing. Can you explain?

uncovery commented 6 years ago

We need to have this list created dynamically on a schedule (like server restart or timer)

uncovery commented 6 years ago

ok, fixed.