[COFF] Perl (was Re: forth on early unix)

John Levine via COFF coff at tuhs.org
Tue Sep 23 11:59:02 AEST 2025


It appears that Tony Patti via COFF <crypto at glassblower.info> said:
>The timings below (from page 80) are for inversion of a 500x500 matrix in
>Galois Field GF(997727), processing 5-million-bit matrix
>encryption/decryption keys:
>
>Python 223        seconds
>PHP        29.6       seconds
>Java       4.3         seconds
>C             2.5         seconds
>Go          1.84       seconds
>Rust       1.7         seconds

Something smells wrong here.  Anyone doing numerical work in python
uses the numpy and scipy libraries which represent arrays in native
binary form and have efficient versions of numerical operations.

This suggests they did a mechanical translation into simple minded
python using ineffiecient data structures rather than the way an
actual python programmer would do it.

Or as someone said "you can write FORTRAN programs in any language."

For reasons I have never figured out, perl's regular expression matcher
is at least twice as fast as the ones in perl or PHP.  I have rewritten
programs that do a lot of regex from python into perl because the
speedup is so great.

If you like awk, I believe that mawk's regex is much faster than the
competition, too.

R's,
John


More information about the COFF mailing list