Remix.run Logo
fph 3 hours ago

If you try profiling almost any program that does linear algebra (something that uses Numpy, for instance), you will see a lot of calls and CPU time in functions with names like DGETRF or SGESVX. These obscure names stand for stuff like Single-precision GEneral matrix Solve Vector eXtended; i.e., solve a linear system of equations with a full, dense matrix. Why are they so difficult to parse? Couldn't they come up with a friendlier name?

They come from Lapack, the standard linear algebra foundation library, which is written in Fortran 77. That library was first written in 1992, when the Fortran 90 standard was still new and not supported everywhere, so they stuck with the earlier version. Lapack has become the standard library for dense non-parallel linear algebra; it is still maintained and updated, but the basic math algorithms haven't changed much, so there was no need to replace it entirely. Today there are also processor-specific libraries like MKL or Apple Accelerate, but they still all follow the same Lapack API.

When Fortran-77 was standardized, they decided to keep function names at most 6 letter long, to "ensure portability". I.e., they wanted to support certain compilers and architectures that were already considered old in 1977.

TL;DR: if you can't read easily those flame graphs today, it's because of backward compatibility with certain mainframes that probably date back to the late 1960s.

KineticLensman 2 hours ago | parent [-]

Cue obligatory reference to the programmer archaeologists in Vernor Vinge's novel A Deepness in the Sky. Their job, on starships, is to safely bodge the multiple strata of software that have accreted since Mankind left Earth, centuries before.