Quantcast
Channel: c++ execution time is slower than python's - Stack Overflow
Browsing latest articles
Browse All 4 View Live

Answer by Doncho Gunchev for c++ execution time is slower than python's

C++'s std::endl flushes the stream, python's print does not. Try using "\n", that should speed up the C++ code.

View Article


Answer by Daniel Trugman for c++ execution time is slower than python's

C++'s advantage in comparison with Python doesn't lie in operations constrained by the OS such as printing to the console, but rather:The fact is it hard typed, thus minimizing run-time overhead due to...

View Article

Answer by user1196549 for c++ execution time is slower than python's

You are not benchmarking the language, you are benchmarking the OS.The time it takes to display text (by the windowing system) is longer than the time to prepare the characters (by your code) by orders...

View Article

c++ execution time is slower than python's

I switched to c++ because i heard its 400 times faster than python, But when i made an infinite loop that increments a variable and prints its value python seems to be faster, How can that be?And how...

View Article
Browsing latest articles
Browse All 4 View Live