djc / askama

Type-safe, compiled Jinja-like templates for Rust
Apache License 2.0
3.25k stars 213 forks source link

Add simple parser benchmark #1043

Closed Kijewski closed 2 months ago

Kijewski commented 2 months ago
As a test, I sped-up the parsing of nodes a bit ```text librustdoc/all time: [355.54 µs 356.38 µs 357.32 µs] thrpt: [39.520 MiB/s 39.623 MiB/s 39.718 MiB/s] change: time: [-18.234% -16.825% -15.541%] (p = 0.00 < 0.05) thrpt: [+18.401% +20.229% +22.301%] Performance has improved. librustdoc/item_info time: [5.0121 µs 5.0287 µs 5.0523 µs] thrpt: [31.145 MiB/s 31.292 MiB/s 31.395 MiB/s] change: time: [-23.798% -22.817% -21.894%] (p = 0.00 < 0.05) thrpt: [+28.031% +29.562% +31.230%] Performance has improved. librustdoc/item_union time: [29.414 µs 29.473 µs 29.544 µs] thrpt: [33.410 MiB/s 33.490 MiB/s 33.557 MiB/s] change: time: [-16.596% -14.874% -13.411%] (p = 0.00 < 0.05) thrpt: [+15.489% +17.473% +19.898%] Performance has improved. librustdoc/page time: [155.88 µs 156.54 µs 157.19 µs] thrpt: [39.392 MiB/s 39.557 MiB/s 39.723 MiB/s] change: time: [-12.364% -11.542% -10.749%] (p = 0.00 < 0.05) thrpt: [+12.044% +13.048% +14.108%] Performance has improved. librustdoc/print_item time: [20.818 µs 20.840 µs 20.866 µs] thrpt: [45.247 MiB/s 45.304 MiB/s 45.351 MiB/s] change: time: [-12.666% -11.880% -10.936%] (p = 0.00 < 0.05) thrpt: [+12.278% +13.482% +14.503%] Performance has improved. librustdoc/short_item_info time: [18.014 µs 18.028 µs 18.047 µs] thrpt: [50.202 MiB/s 50.253 MiB/s 50.293 MiB/s] change: time: [-16.748% -15.854% -14.914%] (p = 0.00 < 0.05) thrpt: [+17.529% +18.842% +20.118%] Performance has improved. librustdoc/sidebar time: [34.118 µs 34.204 µs 34.316 µs] thrpt: [35.961 MiB/s 36.079 MiB/s 36.170 MiB/s] change: time: [-21.998% -21.094% -20.103%] (p = 0.00 < 0.05) thrpt: [+25.161% +26.732% +28.202%] Performance has improved. librustdoc/source time: [18.575 µs 18.599 µs 18.628 µs] thrpt: [39.574 MiB/s 39.637 MiB/s 39.688 MiB/s] change: time: [-13.313% -12.557% -11.734%] (p = 0.00 < 0.05) thrpt: [+13.294% +14.360% +15.358%] Performance has improved. librustdoc/type_layout_size time: [7.6326 µs 7.6403 µs 7.6503 µs] thrpt: [35.403 MiB/s 35.449 MiB/s 35.485 MiB/s] change: time: [-28.176% -27.557% -26.758%] (p = 0.00 < 0.05) thrpt: [+36.533% +38.039% +39.229%] Performance has improved. librustdoc/type_layout time: [50.909 µs 50.962 µs 51.035 µs] thrpt: [52.752 MiB/s 52.828 MiB/s 52.883 MiB/s] change: time: [-10.061% -8.7841% -7.6337%] (p = 0.00 < 0.05) thrpt: [+8.2646% +9.6300% +11.186%] Performance has improved. ```