[ruby/json] Directly use generate_json_string for object keys
generate_json_string
... instead of generate_json.
generate_json
Since the object key is already confirmed to be a string, using a generic dispatch function brings an unnecessary overhead.
This speeds up JSON.generate by about 3% in a benchmark.
JSON.generate
https://github.com/ruby/json/commit/e125072130
[ruby/json] Directly use
generate_json_string
for object keys... instead of
generate_json
.Since the object key is already confirmed to be a string, using a
generic dispatch function brings an unnecessary overhead.
This speeds up
JSON.generate
by about 3% in a benchmark.https://github.com/ruby/json/commit/e125072130