I've created a new command handler that is faster than the standard AggregateAnnotationCommandHandler.
It uses ASM to dynamically generate invokers that using direct method invocation instead of reflection.
I've included a benchmark that compares the performance.
Note about the performance, replacing the standard UUID generator with FastUUIDIdentifierFactory yield much better performance.
It currently does not support callbacks, and aggregate lookup with version.
My application doesn't need them so let me know if you do and I will add it.
Next I will apply the same technique to speedup event handling.
that looks very interesting! I have been looking at ASM for a while, but lacked the time to really dive into it.
This may be a good start to replacing the reflection with generated bytecode in Axon core. The main problem will be to make it robust enough to deal with all the different situations.
As an Axon committer I'd be happy to review this code and extend it to
support all features of Axon command handling.
I'll make a new branch in the Axon repository and put it in the
incubator section.
it’s been a while since we had a look at this. Unfortunately, the colleagure looking into this has left the company. He did dhow me what he had so far, but we didn’t get to integrate it in Axon yet. Mainly what he did was to add support for the ParameterResolver mechanism we included in Axon 2. If I am not mistaken, the current ASM implementation only supports the payload as sole parameter, right?
I’ll review your changes soon and try to incorporate it in the Axon incubator. Thanks anyway for your contribution.