_Comment made by: killme2008_
I develop a patch to fix this issue.I run all the tests in clojure and clojure.data.json, and no one fails.
Use criterium to do a simple benchmark as below:
(use 'criterium.core)
(require '[clojure.data.json :as json])
(bench (json/write-str
{:a 1 :b 2 :c (range 10) :d "hello world"
:e (apply hash-set (range 10))}))
before patch:
Evaluation count : 6180060 in 60 samples of 103001 calls.
Execution time mean : 10.302604 µs
Execution time std-deviation : 597.958933 ns
Execution time lower quantile : 9.631444 µs ( 2.5%)
Execution time upper quantile : 11.618551 µs (97.5%)
Overhead used : 1.724553 ns
After patch:
Evaluation count : 6000900 in 60 samples of 100015 calls.
Execution time mean : 10.212543 µs
Execution time std-deviation : 564.874941 ns
Execution time lower quantile : 9.528383 µs ( 2.5%)
Execution time upper quantile : 11.334033 µs (97.5%)
Overhead used : 1.827143 ns