elastic / elastic/logstash

Can we Flatten `RubyEvent` and `Event` into one?

Open
#7,895 3 comments 1 reaction 0 assignees View on GitHub
discuss performance improvements
Dominant language
Java
Stars
14.9k
Forks
3.5k
Avg merge
1d 4h
Merged PRs (30d)
88

Description

`RubyEvent` doesn't hold any state that isn't also in `Event`, just from the performance perspective it's only a burden.
I can see about `1.5 * workers * batch_size` `Event` not being GCed at any given time for small batch sizes (up to `256` and a much larger factor than `1.5` for larger batch sizes).
Given that these `RubyEvent`s prevent a ton of `HashMap` from being GCed, I expect a visible improvement in memory use from flattening this out.

Is there any reason not to simply move all the `RubyEvent` methods over to `Event`?
(if we want to cleanly separate the Java interface we could still extract the current public methods from `Event` to an interface that new merged class implements?)

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.