3 ms·
You can't use the Python implementation to get insight into what's happening with a C++ implementation, because the overhead of operations in Python may mask a
by hyperpape 9y ago
You can't use the Python implementation to get insight into what's happening with a C++ implementation, because the overhead of operations in Python may mask a real effect that can be seen in C++.
- autokad 9y agonot directly, but information is information. I am also more skeptical that branching alone would result in a 6x increase in run time. We know optimizes unfold loops as well as arrays. it doesnt take a profound leap in logic that the optimizer may have unfolded everything and realized certain code was not going to change the state of the program, thus removed it. Maybe it didnt, but then again maybe it did.
- hyperpape 9y ago> information is information It's information, but not worthwhile information. > It doesnt take a profound leap in logic that the optimizer may have unfolded everything and realized certain code was not going to change the state of the program, thus removed it. Maybe it didnt, but then again maybe it did. Prove it. This article has had a ton of traffic. If you see the thing that everyone missed, a lot of people will be very impressed with you.
- Ultimatt 9y agoDid you try with an actual array or a Python list? https://docs.python.org/3/library/array.html https://docs.python.org/3/library/array.html or numpy you might be able to recover the same effect. Your average line of Python is miles away from low level and simple operations. Pretty much any dynamic language with a large runtime is. Especially when they default to lists not arrays. You should see your result as evidence of that. Not assume this discussion is flawed.