Fwd: Speed versus clarity

Steve <[email protected]>
Newsgroups gmane.comp.mathematics.pari.devel
Message-ID <[email protected]>
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.

Thanks!

Steve
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.