We are using Spring-Integration heavily, and while profiling our application we found a couple of improvements that will increase the overall performance of the framework. In our particular case, we jumped from 16K msgs/sec to 170K msgs/sec (1000% performance gain) which is a huge gain.
Some of critical points we found and that can be improved
- Message ID: UUID generation is really slow and in addition, UUID.randomUUID() is synchronized, which makes message instantiation a bottleneck. Making the ID Generation mechanism pluggable would enable the implementation of different strategies for ID generation. IMHO, there is no need to force the Message ID to be an UUID, wouldn't Serializable be enough?
- MessageHistory: MessageHistory is a feature that we consider very useful for testing environments, but we won't use it in production. It would be nice if it could be turned off.
- AbstractMessageChannel#convertPayloadIfNecessary was another HotSpot. Checking datatype is costly and by default Object is the base type, which makes the check really unnecessary. Maybe, different strategies could be used depending of the current "datatype" array value.
- Type checking using iAssignableFrom (in MessageHeaders) was another HotSpot. Here, we just decided to make a cast and avoid doing the call to that method.
There are other improvements we have made, one of them is already in JIRA: https://jira.springsource.org/browse/INT-1141. Some others have less impact so I left them out of this thread.
What do you think about moving some of these improvements into the framework?