Extracting emails from log files
Don't know if this is affecting your performance, but one thing to check is that you are using an up-to-date version of awk. In particular, the version of awk that ships on MacOS is very slow. You may get dramatic difference by installing the latest GNU gawk. I've measured order of magnitude performance improvements by upgrading. (On MacOS, Homebrew and MacPorts are two popular package managers that can install the latest version.)