As said in #16 , this method is quite hot as it gets called on runtime for every class loaded.
The average time spend in this method before this patch on a miss (which should be most of the time) is ~10 microseconds, which is actually not too bad, but it can be easily improved.
This patch reduces the time spend in this method in any case to a few nanoseconds while keeping the load time roughly the same.
I guess it will not actually be noticible in most real-world cases, after doing some math I figured that it will probably save less than one second in total even in large modpacks, but I'll open this PR anyways as I already wrote the code.
Actual benchmark results for those interested (Comparable to the numbers in #16, same PC):
As said in #16 , this method is quite hot as it gets called on runtime for every class loaded. The average time spend in this method before this patch on a miss (which should be most of the time) is ~10 microseconds, which is actually not too bad, but it can be easily improved. This patch reduces the time spend in this method in any case to a few nanoseconds while keeping the load time roughly the same.
I guess it will not actually be noticible in most real-world cases, after doing some math I figured that it will probably save less than one second in total even in large modpacks, but I'll open this PR anyways as I already wrote the code.
Actual benchmark results for those interested (Comparable to the numbers in #16, same PC):
The second commit reduces the time to build the AT list ever so slightly, results after that: