▲ | dxuh 9 hours ago | |
I have recently started re-implementing parts of the standard library myself just to improve compile times (and I did - massively!), but I purposely kept {fmt} around, because I think it's a great library and I thought it would be as fast to compile as you could possibly make it (it likely still is considering what it can do). Also because the dev put a lot of effort into optimizing compile times [1] and seems to be much smarter than me. So I made benchmark to prove you wrong and show you it's not that easy. But it turns out formatting a couple of numbers and strings is much faster with your basic formatting library [2] [3]. Comparing using `hyperfine --warmup 3 "g++ FILE.cpp"` (and some flags for fmt) I get 72ms vs 198ms. So I changed my mind and might take a crack at replacing {fmt} as well. Cool stuff! Thank you. [1] https://vitaut.net/posts/2024/faster-cpp-compile-times/ [2] https://godbolt.org/z/3YaovhrjP bench-fmt.cpp [3] https://godbolt.org/z/qMfM39P3q bench-rikifmt.cpp |