Hi Ralph, On Fri, 22 Mar 2024 at 03:08, Ralph Goers <ralph.go...@dslextreme.com> wrote: > > On Mar 21, 2024, at 3:19 PM, Piotr P. Karwasz <piotr.karw...@gmail.com> > > wrote: > > > > > > PS: In the `main` branch I plan to replace the default > > ReusableMessageFactory with ReusableLogEventFactory: > > > > * this change should have a minimal impact on memory (events are not > > much larger than messages), > > * it can skip a data transfer between ReusableMessage and MutableLogEvent, > > * it allows the message factory to collect data that is usually > > reserved for events. > > I have to question this. I don’t understand the concept of replacing a > MessageFactory with a LogEventFactory. They are completely different things. > What does this even mean?
We already have two `LogEvent` implementations `MutableLogEvent` (used by `ReusableLogEventFactory`) and `RingBufferLogEvent` that also implement `ReusableMessage`. I plan to merge the two `ReusableMessageFactory` and `ReusableLogEventFactory` classes into a single entity that will produce objects of a single type: `MutableLogEvent`. Currently the default Log4j Core 3.x configuration has 4 object pools: one for `ReusableSimpleMessage`, one for `ReusableObjectMessage`, one for `ReusableParameterizedMessage` and one for `MutableLogEvent`. After the changes only one pool will remain. Piotr