• Niels Lohmann's avatar
    micro-optimization of dump() · 224f9907
    Niels Lohmann authored
    A lot of small changes to avoid memory allocations:
    
    - The locale is only queried once rather than with every number
    serialization.
    - The indentation string is recycled between different calls.
    - The string escape function avoids a copy if no escaping is necessary.
    - The string escape and the space function use a complete switch case
    instead of cascaded ifs.
    
    Cachegrind measures some 15% performance improvement.
    224f9907
json.hpp 442 KB