Closed pichi closed 8 years ago
Oh, this is a great patch. Thank you for your contribution!
FYI.
I ran the poison's benchmark on the new jsone.
RESULT: https://github.com/sile/jsone/blob/master/BENCHMARK.md
SUMMARY and COMPARISON:
| encode type | old | new |
|-----------------------|---------------|---------------|
| string escaping | 934.83 μs/op | 697.40 µs/op |
| string escaping(HiPE) | 481.52 μs/op | 343.38 µs/op |
| large json | 1379.04 μs/op | 1508.22 μs/op |
| large json (HiPE) | 634.06 μs/op | 945.08 μs/op |
| pretty print | 1734.20 μs/op | 2024.11 μs/op |
| pretty print (HiPE) | 956.29 μs/op | 1359.26 μs/op |
INPUT STRING: https://github.com/devinus/poison/blob/2.2.0/bench/data/UTF-8-demo.txt
INPUT JSON: https://github.com/devinus/poison/blob/2.2.0/bench/data/generated.json
The performance of "string escaping" has been significantly improved. On the other hand, encoding performance for a large object has been degraded.
FYI.
As a countermeasure to the above problem, I applied following patch:
This patch improves performance of string encoding significantly: