Solved One big plugin or multiple small plugins

Discussion in 'Spigot Plugin Development' started by Dj_Haski, Mar 9, 2020.

Thread Status:
Not open for further replies.
  1. Hello everyone!

    Currently I am developing a big plugin that consists of multiple “modules” (chat, bans, fun commands and etc), packaged as one big plugin. I can’t decide whether I split my plugin into the smaller plugins and one core plugin or just keep everything as one big plugin. I have read multiple threads and most say that I need to use “multiple plugins and one core plugin”.

    Even so, what should I use and why?
     
  2. Honestly Im just doing one big plugin for my server. Theres no need to have multiple plugins, which increase your server work load.
     
    • Agree Agree x 1
  3. It’s largely up to personal preference - there may be a slight performance boost in keeping things in one plugin, plus less hassle with APIs and dependencies... if it’s really big you could always have different projects in your IDE that get bundled together as modules and shaded into one jar via maven (similar to how multi-version plugins are implemented) - more overhead developing / setting up or refactoring but equivalent when actually run on a server.

    If you’re planning to distribute certain features but not others, then multiple plugins might make more sense, and if you’re planning on releasing it to the community, separate plugins would probably be appreciated. But for private use it shouldn’t make a difference. Just make sure that you’re using good design techniques so if you change your mind later down the line it won’t be too much of a hassle to break it apart.
     
    • Informative Informative x 1
  4. TheJavaHacker

    Supporter

    There's also no need for one giant ass plugin that might end up doing exactly the same as 100 smaller plugins for example.
     
    • Funny Funny x 1
  5. Thank you for detailed answer. So one big plugin is slightly faster than multiple because of instances of JavaPlugin or why?
     
  6. The server has to load every single plugins instead of loading one plugin. Btw, having 100 small plugins or 1 big plugin that all does the same doesnt matter in this case except that the server has to load up and access way more plugins (jar files). I dont get your point.
     
    • Informative Informative x 1
  7. Imagine having to load one plugin instead of 100 plugins. The server has to go through every jar files. Long term wise it doesnt really matter but for starting and shutting down time it does.
     
    • Like Like x 1
  8. Oops, didn’t thought about that. Also, I don’t think I will achieve 100 modules :p Just think about it, it’s crazy!
     
    • Like Like x 1
  9. Plus, whenever an event fires, the event dispatcher has to iterate through every registered event handler, probably going plugin-by-plugin (don't quote me on this). More plugins = more iterations = marginally higher latency, but that wouldn't really be noticeable unless you had tons of event handlers, tons of plugins, and tons of events firing all the time. Also means slightly higher RAM usage since more plugin data is loaded into memory. Again, not a huge issue for most regular circumstances.
     
    • Agree Agree x 1
    • Informative Informative x 1
  10. All right, I think I got enough information. I decided to use one big plugin method.

    Thank you everyone for great answers.
     
    • Like Like x 2
Thread Status:
Not open for further replies.