-
Notifications
You must be signed in to change notification settings - Fork 3.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
flat internal Event representation #1968
Comments
I think the only gotcha is: How would you handle arrays of objects?
|
@clintongormley arrays in general are possibly difficult here, and we probably can't do it the same way ES does. The existing fieldref syntax allows array access of your 'duration' field like |
right, the complete @clintongormley example would become
|
@colinsurprenant thoughts on this? We can still address this later, but I think for now, we can close this until we want to revisit it. Thoughts? |
I think the idea of exploring alternate inner Event data representation is worth keeping open but this is definitely not anything on the radar for now since our focus is now on the Java Event implementation and the added serialization benefits and the new Java Accessors impl which has also improved field reference access performance. |
an idea worth exploring is to move from an internal
Hash
/hierarchical event representation to a simpler flat representation. this is really some early brainstorming, please contribute ideas, thoughts, comments.Overall goals: The LogStash::Event object supports nested structures and a special syntax for accessing nested field (
field references
). Internally, the object's JSON representation is basically the same as the object itself. Can be a hash of hash of hash, or whatever. From a memory usage perspective, this can consume lots of object references. From a serialization point of view, visiting all the objects can be costly. We are interested in exploring some internal-representation improvements that should improve per-event memory usage and event serialization costs.basically instead of having an internal object hierarchy representation like
we could have something like
or, using the logstash path convention:
This could be done while preserving the current
Event
api, making this backward compatible.Pros:
Accessors
class which caches fields path to inner objects values. this would become essentially a 1:1 lookup. it would speed up lookups and remove theAccessors
complexity.Cons:
Event#to_hash
and probably have to perform flat -> hierarchical conversion to create a proper Hash representation of theEvent
.Thoughts?
The text was updated successfully, but these errors were encountered: