Disable NBT Checks on most Interaction blocks by default Or add a config to decide it.
Speiger opened this issue · 3 comments
Describe your enhancement
RS is a really great mod,
But there is a bit of flaws to the system.
NBT checks are really expensive. Even if you optimize them there is cases where NBT checks shouldn't be done.
So Export/Import/Etc shouldn't do NBT comparasons on their own by default.
It is good to have the option but have a config to turn of NBT checks by default so users don't have to remember to save servers some grief.
Its a nice performance enhancement that you can do.
I remember where we had huge performance issues just because NBT checks were enabled by default and it wasn't needed but the expensive checks still happened.
(To be fair we are running a custom version where I already did that because I didn't want to wait for you to accept/deny that change but other server owners would thank you for that if you disabled it by default or gave the option in configs)
Do you have any numbers from profiling, so we can make our own opinion on how much of an improvement this would be?
Honestly, right now no exact data, only past server issues that were fixed the moment we disabled NBT compare on only RS storage interfaces that were hooked up to drawers.
But also its quite easy to math out: You iterate over the targets item NBT every single entry just to compare if they match and that is going recursively.
And HashMap Iterators aren't the fastest since you also iterate over the empty entries.
To put it in a simple way:
If you enable NBT Compare you do List.contains(), vs Set.contains when NBT checks are disabled.
That is the computational difference that NBT Checks by default can cause. So Saying its a Opt In Method instead of a OptOut
(Configs to allow server owners to decide, would make it easier) is a good idea.
What I am asking:
Please provide configs to allow server owners to preemptively prevent server issues, or implement them yourself, you know which should have to be NBT Compare by default and what not.
Edit:
NBT compare since ID flattening is also less important then to 1.12 times. Especially since mcs crafting system doesn't support NBT by default so you can expect that 95% of stuff you work with doesn't require NBT, so OptIn method seems also more reasonable.