gnodet opened a new pull request, #23794:
URL: https://github.com/apache/camel/pull/23794

   [CAMEL-23686](https://issues.apache.org/jira/browse/CAMEL-23686)
   
   ## Summary
   
   - Move all 23 fields from `ExtendedExchangeExtension` directly into 
`AbstractExchange`
   - `AbstractExchange` now implements `ExchangeExtension`; 
`getExchangeExtension()` returns `this`
   - Eliminates one 80-byte object allocation per exchange
   
   ## Context
   
   The `ExtendedExchangeExtension` class was introduced in CAMEL-15105 to 
decouple the `ExtendedExchange` interface from `Exchange`, eliminating 
`instanceof` casts that caused JIT megamorphism issues. The decoupling created 
a separate object per exchange to hold internal state.
   
   This PR preserves the API benefit (callers still use 
`exchange.getExchangeExtension().method()` without casting) while eliminating 
the allocation cost by inlining the fields back into `AbstractExchange`.
   
   ## Benchmark results
   
   Pipeline route (timer + split(1000) + CBR + direct, prod+pooled, 60s):
   
   | Metric | Before | After | Change |
   |--------|--------|-------|--------|
   | Baseline heap | 79 MB | 65 MB | **-18%** |
   | Pipeline heap | 2,636 MB | 2,358 MB | **-11%** |
   | ExtendedExchangeExtension instances | 926K (74 MB) | **0** | 
**eliminated** |
   
   ## Test plan
   
   - [x] 7,127 camel-core tests pass (0 failures)
   - [x] 68 exchange/UoW/pooled-exchange tests pass
   - [x] Full `mvn install -Dquickly` succeeds


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to