3 ms·
I would be cautions of claiming performance improvements without the benchmarks to back it up. The compiler is often very good at figuring out if a length is co
by ChrisSD 5y ago
I would be cautions of claiming performance improvements without the benchmarks to back it up. The compiler is often very good at figuring out if a length is constant and optimizing appropriately. I suspect it'd be able to do it in the simple examples given. But maybe I'm wrong!
Admittedly it can be nice not to be at the mercy of the optimizer. And getting compiler errors instead of runtime panics is a really great benefit. But I've just become slightly wary of big performance claims these days. Perhaps I'm just getting too cynical.
- NoraCodes 5y agoAbsolutely, I should have included a godbolt link or something, and it will vary on a case by case basis - but still, and especially across function boundaries, using const generics makes things more predictable.