If you're on Linux chances are that it's already being built in release mode, otherwise you'll need to remove the
-g flag from the compiler statement. Not sure if VS Code offers some option to easily switch between the two.
Also make sure to install a proper GPU driver.
Since you don't really offer any other information, it's kind of hard to help you.
Personally, I recommend using CMake, that way you could even use it with VS on Windows and other CMake-compatible IDE (e.g. Qt Creator, CLion, etc.). See here a simple CMake template:
https://github.com/eXpl0it3r/cmake-sfml-project