Github user revans2 commented on the issue: https://github.com/apache/storm/pull/2379 @kevpeek I agree that it might not be worth merging it right now. But there is room for improvement. The first thing I would do is to pre-allocate the possible return values as lists. We should avoid as much memory allocation as possible within chooseTasks. assignmentCreator.createAssignment is also returning a newly created object. We could at least turn that into an int array, so there is only one object allocated instead of 3. You might also consider refactoring createAssignment to take a reference to targetSelector so you don't need to create a class that is an intermediary between the two. Just have targetSelector take two ints and return one of them, no object allocation at all. If you are still having performance issues after that I can probably help with some profiling.
---