KAMKEEL / CustomNPC-Plus

Custom Version of 1.7.10 CustomNPC with backported features and original expansions
https://www.curseforge.com/minecraft/mc-mods/customnpc-plus
Other
53 stars 34 forks source link

refactor: use `Zstd` compression to save playerdata instead of storing it in JSON. #19

Closed luiz-otavio closed 2 years ago

luiz-otavio commented 2 years ago

Few days ago, I found that CNPC+ Storage Strategy is saving any playerdata inside JSON files with their own encoder/decoder. Many people found spike lags and large files inside their storage, so basically I updated it to use Zstd and then I got a big difference between 2 files:

The first one, is a dat file compressed with Zstd and the another one is the regular file which is stored with JSON. It show for us 94% of disk optimization for just player data. There are many things which is stored with JSON, but for now I just updated it to use player data.

I think it's a good idea if we could make some forge events to listen to usual custom-npc functions. I ensure I had tested it in my local machine and seems it's really working.

I make some implementations such as:

Eisenbahn commented 2 years ago

That's pretty awesome! I was looking for a similar solution <3

KAMKEEL commented 2 years ago

Hi @luiz-otavio Are you part of the CustomNPC+ Discord? I'd like to discuss these changes.

Code: bfGkEZ9T9h

luiz-otavio commented 2 years ago

Yea, I didn't notify you guys cause I was so busy. It's my IGN: Wizard#7240

KAMKEEL commented 2 years ago

Closed until further correction or analysis