"Joel Jacobson" <j...@compiler.org> writes: > On Sat, Jun 29, 2024, at 17:25, Tom Lane wrote: >> (In general I find this patch seriously undercommented.)
> However, I think the comments above split_var_at(), > mul_var_karatsuba_full() and mul_var_karatsuba_half() > are quite good already, what do you think? Not remarkably so. For starters, heaven help the reader who has no idea what "the Karatsuba algorithm" refers to. Nor is there any mention of why (or when) it's better than the traditional algorithm. You could at least do people the courtesy of providing a link to the wikipedia article that you're assuming they've memorized. There's also a discussion to be had about why Karatsuba is a better choice than other divide-and-conquer multiplication methods. Why not Toom-Cook, for example, which the aforesaid wikipedia page says is faster yet? I suppose you concluded that the extra complexity is unwarranted, but this is the sort of thing I'd expect to see explained in the comments. regards, tom lane