0

Why are operators faster than operators in Python? Is this normal in other languages, such as Java and C++?

Hello! Here's a Python time comparison between 8**8 and pow(8, 8): https://code.sololearn.com/cDWpx57aj992/?ref=app It shows, that 8**8 is 20–40 times faster than pow(8, 8). Operators are faster than named functions? Why? Is it normal in other languages, such as Java and C++?

25th Sep 2020, 8:35 AM
Seb TheS
Seb TheS - avatar
1 Resposta
+ 2
https://stackoverflow.com/questions/20969773/exponentials-in-JUMP_LINK__&&__python__&&__JUMP_LINK-x-y-vs-math-powx-y#20970087 In general other languages like C++ are a lot faster than Python and also standard library functions usually have no measurable overhead. So this seems to be a Python specific problem.
25th Sep 2020, 8:44 AM
Aaron Eberhardt
Aaron Eberhardt - avatar