Netflix/Hystrix — pull request #264 by tootedom (2014-05-18 11:17:48+00:00)
Title: defer the Creation of ISE, to when an exception needs to be created

Hi there,

I noticed that an ISE is always created in the doOnComplete, even if the exception case does not occur, which incurs a slight performance hit from the Exception construction and it's initialisation of the stack trace (fillInStackTrace()):

- https://github.com/Netflix/Hystrix/blob/master/hystrix-core/src/main/java/com/netflix/hystrix/collapser/RequestBatch.java#L146

The PR moves this to the passing in of a String that represents the ISE Exception Message if/when it occurs.

You could tackle it by having a custom ISE that overloads the fillInStackTrace() method to return null, and have a custom method that calls super.fillInStackTrace() if/when required.

cheers
/dom