Steve on Wed, 29 Mar 2023 02:43:13 +0200

[Date Prev] [Date Next] [Thread Prev] [Thread Next] [Date Index] [Thread Index]

Fwd: Speed versus clarity

Greetings, number theory maniacs!

In general, is the coding style of Pari meant to be biased towards clarity or towards performance? Obviously there's a continuum, but the Pari project itself might prefer cleaner elegant code over most performant just for maintenance and readability.

I ask since I am an obsessive optimizer, and I often squeeze out performance by special casing rare cases in order to streamline common cases. This tends to expand code size (often by 10x!) but also gives measurable performance.

So is replacing five clean lines of code in Pari for something simple and fundamental like issquare()  with an expanded function of 60 lines acceptable if that replacement is two times faster?  I of course could just write up the patch and submit it and it can be discussed in specifics at that point, but I wanted to get any quick guidance of whether this kind of code expansion would be eagerly viewed, discouraged, or (most likely!) considered but likely judged based on clarity/size/speed tradeoffs.