CommandHelper initial class discovery question

Discussion in 'CommandHelper' started by MrSnowGlobe, Oct 25, 2017.

  1. MrSnowGlobe

    MrSnowGlobe New Member

    Hello,

    I am running a setup where Minecraft server boot time has to be as low as possible.

    On server boot, CH spends 10 seconds (on average) running initial class discovery, see logs below:

    Code (Text):
    [15:04:32] [Server thread/INFO]: [CommandHelper] Running initial class discovery, this will probably take a few seconds...
    [15:04:42] [Server thread/INFO]: [CommandHelper] Loading extensions in the background...
    Is there anything I can do to speed up this process?

    Many Thanks,
    Snow
  2. PseudoKnight

    PseudoKnight Well-Known Member

    That 10 seconds there has nothing to do with the class discovery process (which you'll be happy to learn runs on a separate thread) because the class discovery happens after the second message. The only thing that happens between those two messages is CH grabbing the server (eg. Bukkit.getServer()). That shouldn't take any time at all. I wonder if something else is happening right at that moment during the server load.
  3. PseudoKnight

    PseudoKnight Well-Known Member

    I'm looking into this. I wonder if it has to do with the synchronization on the second message. It's clearly waiting on something, but what..
  4. MrSnowGlobe

    MrSnowGlobe New Member

    Awesome, thankyou so much. Can I assist by proving any other information?
  5. PseudoKnight

    PseudoKnight Well-Known Member

    Okay, it's the getServer(). It's using the Bukkit convertor, which means it has to wait for the class discovery... which as far as I can tell defeats the purpose of putting class discovery on a separate thread. I'm going to try some things.
  6. PseudoKnight

    PseudoKnight Well-Known Member

    Okay, I submitted a PR to LadyCailin to help with this. It appears CH is doing this for reflection purposes, which is great for extensions, but it's not really necessary for the server jar. So, if I'm not missing something, this should be improved soon.
  7. PseudoKnight

    PseudoKnight Well-Known Member

  8. MrSnowGlobe

    MrSnowGlobe New Member

    Thank you so much for this! I shall try when I get home from work (ETA 10 hours as of posting this)

    Do you take donations/tips PseudoKnight?
  9. PseudoKnight

    PseudoKnight Well-Known Member

    As long as you know that I'm not the lead developer of CommandHelper. It's LadyCailin's project and she does all the work on MethodScript. I help mostly with the Minecraft side of things in the last few years. But since I don't have any income recently, I shouldn't turn down donations/tips. Any amount is a huge deal for me. So you're welcome to do so... or not. I have no expectations.
  10. MrSnowGlobe

    MrSnowGlobe New Member

    I understand all that! I've been using CH for a good 5 years now. You have helped us out a few times (us = myself and spudsrus). So, I want to donate to you and LadyCailin accordingly :)
  11. PseudoKnight

    PseudoKnight Well-Known Member

    I'm glad I've helped, and thank you!