Concurrency and Performance Improvements to DataFixers
Found some more unsafe operations in DataFixers. Also replaced quite a few bad uses of Map.containsKey containsKey is a common newbie mistake that "reads" cleaner, but results in double the performance cost of all map operations as containsKey in MOST cases where null values are not used is identical to get() == null Considering how deep datafixers go in call stacks, with tons of map lookups, this micro optimization could provide some gains. Additionally, many of the containsKey/get/put style operations were also a concurrency risk, resulting in multiple computation/insertions.
This commit is contained in:
@ -105,7 +105,12 @@ done
|
||||
importLibrary com.mojang datafixerupper com/mojang/datafixers \
|
||||
schemas/Schema.java \
|
||||
DataFixerUpper.java \
|
||||
NamedChoiceFinder.java \
|
||||
functions/PointFree.java \
|
||||
types/Type.java \
|
||||
types/DynamicOps.java \
|
||||
types/templates/Tag.java \
|
||||
types/templates/TaggedChoice.java \
|
||||
types/families/RecursiveTypeFamily.java
|
||||
|
||||
# dont forget \ at end of each line but last
|
||||
|
||||
Reference in New Issue
Block a user