Skip to content

Commit

Permalink
Merge pull request #3109 from fluent/improve-parser_json
Browse files Browse the repository at this point in the history
parser_json: Improve performance by reducing function call
  • Loading branch information
repeatedly authored Aug 21, 2020
2 parents 2f80f6c + 272d785 commit 3b760f5
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions lib/fluent/plugin/parser_json.rb
Original file line number Diff line number Diff line change
Expand Up @@ -71,8 +71,11 @@ def configure_json_parser(name)
end

def parse(text)
r = @load_proc.call(text)
time, record = convert_values(parse_time(r), r)
record = @load_proc.call(text)
time = parse_time(record)
if @execute_convert_values
time, record = convert_values(time, record)
end
yield time, record
rescue @error_class, EncodingError # EncodingError is for oj 3.x or later
yield nil, nil
Expand Down

0 comments on commit 3b760f5

Please sign in to comment.