4 ms·
It might be a significant problem, but not in the code, but the compiler. Fair enough, you are working around a compiler issue.
by badmintonbaseba 2y ago
It might be a significant problem, but not in the code, but the compiler. Fair enough, you are working around a compiler issue.
- Ono-Sendai 2y agoIf you consider any superlinear complexity a 'compiler issue' I guess.
- badmintonbaseba 2y agoIt absolutely is, if it makes compile times unreasonable for reasonable code. Compilers have to make trade-offs like this all the time, they can't use overly excessive optimizations.
- Ono-Sendai 2y agoI dunno. O(n^2) is for sure a bug. But O(nlogn) I think is reasonable.
- badmintonbaseba 2y agoO(nlogn) is probably reasonable. Why break up a long function then if you are experiencing O(nlogn) scaling of compile time on function size?
- Ono-Sendai 2y agoBecause it can still result in compile times I find excessive. For example breaking up a function that takes 5 seconds to compile into a bunch of functions that take 1 to 2 seconds in total.