You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Jan 26, 2019. It is now read-only.
Explanation of issue:
In WarmRoast report ~36% CPU load is NBTTagCompound.equals() method. This method compares HashMap, but it's very slow. I suggest compare hashCode at first to escape checking the obviously different NBTs. That hashCode() be fast, we may cache he value and update it on change NBT. For example:
private int hash;
public void setInteger(String key, int value) {
// Set value
this.markDirty();
}
private void markDirty() {
this.hash = 0;
}
public int hashCode() {
if (this.hash == 0) this.hash = oldHashCode(); // Old hashCode() function
return this.hash;
}
public boolean equals(NBTTagCompound other) {
return this.hashCode() == other.hashCode() && oldEquals(other); // Compare hash and old equals() function.
}
The text was updated successfully, but these errors were encountered:
Hmmm... Problem.
The NBTTagCompound returns a NBT (for example other NBTTagCompound), on the changes that the parent NBT is not aware. Make references to parents in child NBTs - not the best idea. I don't know how to solve this problem.
Sign up for freeto subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Mods Installed:
ThermalDynamics
Warmroast Report: (Optional)
http://paste.enginehub.org/CuVc9L.profile
Thermos Version:
58-ALPHA
Forge Version:
1614
Explanation of issue:
In WarmRoast report ~36% CPU load is NBTTagCompound.equals() method. This method compares HashMap, but it's very slow. I suggest compare hashCode at first to escape checking the obviously different NBTs. That hashCode() be fast, we may cache he value and update it on change NBT. For example:
The text was updated successfully, but these errors were encountered: