C++ code compiled from a command line shell script runs much faster than when I use the same shell script from a Task:Run in VSCode. I successfully tried an echo command in the script to make sure VSCode was running the same script I use at the command line.
I know there are compiler settings in a .json file, but I don't see how to add a -O3 optimization switch, and since VSCode is running the same script I used at the command line I just don't get why it might be different.
I'm on a new M1 Mac and here's my script: clang++ -std=c++17 -O3 -o $1 $1.cpp && $1
The VSCode resulting speed is midway between the -O3 option and no optimization. Weird.... At first I thought it might be the terminal in VSCode but the code runs same slowness if I execute it at the external command line, so that's not it.