@ Benchmark public ExampleClass benchmarkByteBuddyWithProxyAndReusedDelegator ( ) throws Exception { return new ByteBuddy ( ) . with ( TypeValidation . DISABLED ) . ignore ( none ( ) ) . subclass ( baseClass ) . method ( isDeclaredBy ( baseClass ) ) . intercept ( proxyInterceptor ) . make ( ) . load ( newClassLoader ( ) , ClassLoadingStrategy . Default . INJECTION ) . getLoaded ( ) . getDeclaredConstructor ( ) . newInstance ( ) ; }
Performs a benchmark of a class extension using Byte Buddy . This benchmark also uses the annotation - based approach but creates delegation methods which do not require the creation of additional classes . This benchmark reuses a precomputed delegator .