Multi thread/async database loading

Issue #89 resolved
Former user created an issue

Currently the database loading is slow and use only one CPU core.
It would be better if the plugin load the database with multiple CPU cores.

Kreatív >  Loaded 8301808 blocks from database!
Kreatív >  Done! Took 365462ms

Comments (9)

  1. Hans Kurel repo owner

    I’ve been sitting on that issue for a while now and I’ve concluded the following.

    The time it takes to load blocks from the database depends on what else the server is doing at that moment. I had a literal 10x difference in loading time depending on whether or not I had a few other plugins installed. This means that a) I’m doing something wrong, b) runTaskAsynchronously isn’t working properly, or c) the server doesn’t use another CPU core for async processing.

    I did some tweaking and I loaded 175k blocks in 1-1.6 seconds. Put back other plugins and that number jumps to 15 seconds. However, debugging shows that the actual time spent on loading was still 1.6 seconds. Most of the 15 seconds was spent on waiting in line in the Bukkit scheduler to do the actual processing. So, the time RC shows doesn’t tell the whole picture.

    I’ll think about it some more and get back to you.

  2. Former user Account Deleted reporter

    Okay. My database currently store 8618293 blocks, and it load in 439663 ms.

    Couldn't this be somehow accelerated?

  3. Hans Kurel repo owner

    I can display the time it actually takes to load the blocks and it’ll look much faster, but it doesn’t solve the underlying problem. I believe I can make this better in the next version.

  4. Hans Kurel repo owner

    It’s interesting that it’s faster thanks to them, because the problem shouldn’t be dependent on the server implementation. Nevertheless, I’m glad your issue is resolved.

  5. Log in to comment