C++ can be slower than Python?

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
this mistake will make C plus plus slower than python so in our Python program we are creating a collection with 10 million elements defining a function calling the function 100 times [Applause] now in our C plus plus code we are creating a collection with 10 million elements defining a function [Music] and calling that function 100 times would it surprise you if I said the python code will actually run faster let's compare first let's run our python code [Music] now let's compile and run our C plus plus code [Music] C plus plus is much slower because we are creating a copy of the collection every time we call the function to fix this simply add an ampersand to pass the collection by reference [Music] if you enjoyed this video remember to subscribe to see more videos like this one [Music]
Info
Channel: The Builder
Views: 75,824
Rating: undefined out of 5
Keywords:
Id: eUZctvytMt0
Channel Id: undefined
Length: 1min 39sec (99 seconds)
Published: Sat Nov 12 2022
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.