-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
Use 'oj' for performance improvement when oj is installed #748
Conversation
@tagomoris @sonots How about this? |
Should we use multi_json? It does exactly what we're doing here (selects the best available json library). |
@mr-salty It is one idea. I considered |
I added oj support in formatter. In addition, I added |
Very interesting. Let us go ahead. |
@@ -131,8 +131,22 @@ class JSONFormatter < Formatter | |||
include HandleTagAndTimeMixin | |||
include StructuredFormatMixin | |||
|
|||
config_param :disable_oj, :bool, :default => false |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Option like json_parser oj
or json_parser yajl
looks better because there exists more parsers (cf. https://github.com/intridea/multi_json#supported-json-engines)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't want to support more parsers and I want to remove this option in the feature.
So I don't want to use more better name because users may misunderstands fluentd will support another parsers.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Okay, please leave the comment in codes.
Use 'oj' for performance improvement when oj is installed
Use 'oj' for performance improvement when oj is installed
oj is faster json library and it improves
JSONParser
performance.I tested in_tail with following json.
Result is
Oj result is better than Yajl so using oj is better when oj is installed.