Please sign in to comment.
Probable fix for slowness.
This commit caches the native class along with the FQCN, which can be used to seriously speed up the lookup elsewhere, particularly when using instanceof. The only exception to this is DynamicEnums, but there are so few of those that it doesn't cause enough of a performance hit. This speeds up RandomTests by an order of magnitude, but there were other performance increases that should have helped some as well (though not an order of magnitude.) The end result is that this should actually be a bit faster than the original code anyways.
- Loading branch information...
Showing with 101 additions and 38 deletions.
- +2 −2 src/main/java/com/laytonsmith/PureUtilities/ClassLoading/ClassDiscovery.java
- +59 −2 src/main/java/com/laytonsmith/core/FullyQualifiedClassName.java
- +1 −1 src/main/java/com/laytonsmith/core/Static.java
- +16 −9 src/main/java/com/laytonsmith/core/constructs/CClassType.java
- +2 −2 src/main/java/com/laytonsmith/core/constructs/InstanceofUtil.java
- +7 −6 src/main/java/com/laytonsmith/core/constructs/NativeTypeList.java
- +11 −11 src/main/java/com/laytonsmith/core/exceptions/CRE/CREThrowable.java
- +2 −4 src/main/java/com/laytonsmith/core/functions/Reflection.java
- +1 −1 src/test/java/com/laytonsmith/core/constructs/EnumTest.java