3 ms·
> IMO the issue with the given Postgres example isn't that it is written in C therefore it is slow, it is why it doesn't use all of C's features to make it fast
by RcouF1uZ4gsC 4y ago
> IMO the issue with the given Postgres example isn't that it is written in C therefore it is slow, it is why it doesn't use all of C's features to make it faster
I think the issue the author is pointing out is that, in the real world, this real-life (fairly obvious) performance improvement was enough of a pain in C, that it was not done for 25 years.
In languages with generics, this improvement would have come for free. With C, yes you can do the improvement, but you have to do it by hand, and you have now to maintain and debug multiple versions of sort.
- cozzyd 4y agoWell, as parent noted, you can use sglib, or implement your own thing in a similar manner (it's not that hard, sglib.h is very readable...).
- badsectoracula 4y ago> was enough of a pain in C, that it was not done for 25 years As i wrote in another reply, that might be one way to read the situation - especially if you want to create a narrative where languages like C without generics have inherent faults - but another way is that it was there for 25 years because it wasn't an actual problem in practice so nobody bothered to fix it until now.
- ayende 4y ago4% - 6% overall query time improvement? That is absolutely an actual problem that is very attractive to solve. You'll see database people jump through far bigger hoops to get much smaller improvements.