rinja-rs / rinja

A template rendering engine based on Jinja, generating type-safe Rust code at compile time.
https://rinja.readthedocs.io
Apache License 2.0
116 stars 10 forks source link

Implement `FastWritable` for `|json` #124

Closed Kijewski closed 1 month ago

Kijewski commented 1 month ago

escape JSON             time:   [7.5003 µs 7.5130 µs 7.5271 µs]
                        change: [-14.410% -14.012% -13.643%] (p = 0.00 < 0.05)

escape JSON (pretty)    time:   [7.4790 µs 7.4907 µs 7.5052 µs]
                        change: [-15.374% -14.949% -14.591%] (p = 0.00 < 0.05)

escape JSON for HTML    time:   [11.428 µs 11.446 µs 11.466 µs]
                        change: [-9.6135% -8.5244% -7.8519%] (p = 0.00 < 0.05)

escape JSON for HTML (pretty)
                        time:   [11.394 µs 11.413 µs 11.435 µs]
                        change: [-10.979% -10.701% -10.449%] (p = 0.00 < 0.05)
GuillaumeGomez commented 1 month ago

Nice found, thanks!