Inspectopedia
 
2024.3

Too long same methods chain

Warning
Performance
New
Last modified: 03 December 2024

Reports long Reactive Streams transformation chains.

Each operator method call, such as map() or filter(), creates some objects for those operators. Calling a long chain of operators on each subscription, for each stream element, may cause performance overhead. To avoid it, combine a long chain of calls into one operator call wherever possible.

Example:

After the quick-fix is applied:

New in 2019.3