Skip to content
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

Replace Jackson with custom JSON emitter #44

Open
vy opened this issue Sep 7, 2019 · 0 comments
Open

Replace Jackson with custom JSON emitter #44

vy opened this issue Sep 7, 2019 · 0 comments

Comments

@vy
Copy link
Owner

vy commented Sep 7, 2019

While Jackson is the de facto JSON serialization library in the Java world and log4j2-logstash-layout enjoys its great performance, flexibility, and customization features, it is currently the slowest chain in the entire serialization pipeline. Given log4j2-logstash-layout only serializes LogEvents into JSON, a custom JSON emitter can very well be implemented in a pretty straightforward way.

Pros

  • No external (required) dependency
  • Faster serialization

Cons

  • A byte[] recycler will need to be implemented to avoid GC
  • Jackson is still needed as an optional dependency while serializing Messages that are not SimpleMessage
  • null entry elimination might need to be dropped (difficult to get right)

@mkedwards Would you (or your company) be interested in sponsoring such an effort?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant