netty5/common
Nick Hill 768a825035 Avoid CancellationException construction in DefaultPromise (#9534)
Motivation

#9152 reverted some static exception reuse optimizations due to the
problem with Throwable#addSuppressed() raised in #9151. This introduced
a performance issue when promises are cancelled at a high frequency due
to the construction cost of CancellationException at the time that
DefaultPromise#cancel() is called.

Modifications

- Reinstate the prior static CANCELLATION_CAUSE_HOLDER but use it just
as a sentinel to indicate cancellation, constructing a new
CancellationException only if/when one needs to be explicitly
returned/thrown
- Subclass CancellationException, overriding fillInStackTrace() to
minimize the construction cost in these cases

Result

Promises are much cheaper to cancel. Fixes #9522.
2019-09-05 11:07:24 +02:00
..
src Avoid CancellationException construction in DefaultPromise (#9534) 2019-09-05 11:07:24 +02:00
pom.xml [maven-release-plugin] prepare for next development iteration 2019-08-13 17:16:42 +00:00