Minecolonies & Core-Rework-Refactoring-Madness #3

in #utopian-io7 years ago (edited)

Hey everyone, as mentioned here one last step was missing to complete my final refactoring madness.

Since we, as mentioned already, store all our colonies in the same data file, we have to write all of them together to the same data file the moment one of them changes, and, as you may imagine, this causes a huge amount of IO overhead as soon as we have a decent amount of colonies.

Therefore, I rewrote the mechanic a bit.

First of all, where we previously marked the colonyManager dirty so he writes all colonies to disk we now adapted this the following way:

So that he immediatly writes only the colony to disk.

Then in the colonyManager when loading colonies we store a "dummy" in the colonies dat to see if we already switched to the new mode and if not, we'll retrieve the colonies the old way to store them the new way afterwards:

The new way would then be the following:

As mentioned we check for the dummy, then we get the amount of colonies we want to retrieve, we add a certain buffer if anyone lost their colony the last time.
And then we retrieve File per file of each colony.

Besides that I had to adapt our "backup" storage and I made it quite nice.

I take all colonyX.dat files and the overall colonies.dat file and I add them to a backup.zip file. This way it will need less space and we have clearly organized backups.

Last but not least we have to delete every colony.dat as soon as we delete a colony or else the world will try to retrieve them on the next restart.

This should improve our overall server performance with ~ 200 colonies by approximately 20%.

I hope this improves our mod a lot, it will also allow us to rollback single colony files and overally improves out mod performance by a lot.
And leave our minecolonies folder like this:

Pasted image at 2018_01_11 04_44 PM.png

See you the next update.

Ray



Posted on Utopian.io - Rewarding Open Source Contributors

Sort:  

Thank you for the contribution. It has been approved.

You can contact us on Discord.
[utopian-moderator]

Hey @reggaemuffin, I just gave you a tip for your hard work on moderation. Upvote this comment to support the utopian moderators and increase your future rewards!

may l coming to the utopian community

Hey @raycoms I am @utopian-io. I have just upvoted you!

Achievements

  • You have less than 500 followers. Just gave you a gift to help you succeed!
  • You are generating more rewards than average for this category. Super!;)
  • Seems like you contribute quite often. AMAZING!

Community-Driven Witness!

I am the first and only Steem Community-Driven Witness. Participate on Discord. Lets GROW TOGETHER!

mooncryption-utopian-witness-gif

Up-vote this comment to grow my power and help Open Source contributions like this one. Want to chat? Join me on Discord https://discord.gg/Pc8HG9x

Sorry if I am asking a silly question here, but what is this mod for? This is the first post I've seen so I'm just wondering what I'm missing out on, because whatever it is it looks like it may interest me. Thanks :)

Hey there, it's a colony building mod which adds the chance to add a colony to your minecraft world.
For more info: http://www.minecolonies.com/

Sounds awesome, I'll be sure to try it out.

awesome post thank you for sharing

Thanks for sharing dear keep it up I follow you and always wait for your feature posts

Its good informative post. It will help the stemit community. Nice post.

it was confusing me, but l will learn it, thanks men..

Some really great gaming content here definitely an upvote from me, hope to see more content from you real soon, as a fellow gamer I'd like to also ask if you can check my gaming content out too and leave a comment or two and maybe even a follow

Good post! .. I will also follow you, follow me and we help each other ... I would appreciate a vote in my last post thanks
https://steemit.com/gaming/@misc.jocs/steemit-it-was-a-quiet-day-when-suddenly-assasins-creed-black-flag

Thanks you for the post my friend! I need to start utilizing these tools! That's how you make the most of the platform till you hit the ground running. Running on E right now... @raycoms

Coin Marketplace

STEEM 0.19
TRX 0.13
JST 0.030
BTC 62907.89
ETH 3379.73
USDT 1.00
SBD 2.50