Skip to content

Commit c18cb04

Browse files
committed
Improve buffering performance
1 parent b1f8a7c commit c18cb04

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

comfortable-swipe.cpp

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,13 +16,21 @@ You should have received a copy of the GNU General Public License
1616
along with this program. If not, see <http://www.gnu.org/licenses/>.
1717
*/
1818

19+
#include <ios> // std::ios
20+
#include <iostream> // std::cin, std::cout, std::cerr
1921
#include <string> // std::string
2022
#include "lib/comfortable_swipe"
2123

2224
/* MAIN DRIVER FUNCTION */
2325

2426
int main(int argc, char** args)
2527
{
28+
// improve buffering by decoupling loggers from stdio
29+
std::ios::sync_with_stdio(false);
30+
std::cin.tie(0);
31+
std::cout.tie(0);
32+
std::cerr.tie(0);
33+
2634
if (argc > 1)
2735
{
2836
std::string arg = args[1];

0 commit comments

Comments
 (0)