std::cout << std::endl is not always faster than std::cout << “\n”
std::endl writes a newline to the output stream and flushes it. In most cases, the developer doesn’t need to flush. Flushing operation is expensive, because it involves a system call. Instead of std::endl, you can simply write “\n”. Then the content will be flushed if the content size is more than the buffer size or the application closes.