2 ms·
awk is a language with multiple implementations, so we can only talk about performance of a particular awk implementation. Which is especially true for awk beca
by tannhaeuser 7y ago
awk is a language with multiple implementations, so we can only talk about performance of a particular awk implementation. Which is especially true for awk because mawk (based on a vm rather than being a traditional interpreter) is so much faster than other awks if you can live with its limitations [1]. If you're using gawk, setting LANG=C also helps performance because no utf-8 honoring needs to be done. Speaking of which, I've noticed gawk on recent Ubuntus (19.10) appears broken and/or has regexp size limits breaking awk code with large regexpes (but haven't checked yet thorougly).
[1]: https://brenocon.com/blog/2009/09/dont-mawk-awk-the-fastest-and-most-elegant-big-data-munging-language/ https://brenocon.com/blog/2009/09/dont-mawk-awk-the-fastest-...
- arendtio 7y agoArch Linux $ awk --version GNU Awk 5.1.0, API: 3.0 (GNU MPFR 4.0.2, GNU MP 6.2.0)
- arendtio 7y agoSince others were suggesting mawk too, I just installed it and it was indeed faster than GNU awk: The task took about 7 seconds. Interesting enough: LANG=C increased the performance of GNU awk a bit, but actually decreased the mawk performance.