What made the C assembly look unnecessarily complicated was the lack of formatting. You could have used spaces, better alignment with tabs, and base 10 digits for the purposes of this tutorial.
Interesting point! I posted from a decompiler and didn't notice the inconsistent indentation. Next time, I'll be more careful. Thanks for the feedback!!
The term: "von Neumann architecture" is used intermittently and inconsistently in computer science. Most sources that use it have crappy explanations, and most sources with good explanations don't use it. IBM hired John von Neumann as a consultant in 1951. I was hired in 1978. The entire time I was there I never heard or saw any mention of him or his namesake. Of course Eckert and Mauchley may have thought of it before he did, but von Neumann got all the credit.
You are absolutely correct! In academia, we use von Neumann architecture really vaguely. It drives me nuts when colleagues call our current multi-core/multi-processor systems "von Neumann machines!" While you were working at IBM, I was building mainframes with Burroughs. We NEVER called our machines von Neumann machines! :D
@@wizardcraftcode "Merlin" Great name! Any sufficiently advanced technology is indistinguishable from magic. A "von Neumann machine" is what von Neumann called a "universal constructor". Beat an academic every chance you get. Have you checked out Dennis Taylor's Bobiverse? LOL
9:50 Hi! If I'm correct both example c and java loops involve conditional branch on every iteration. The difference is mainly in loop header location(compiled program text-wize) relative to the loop body and hence the direction we jump or not jump when loop condition is true. I believe C strives to satisfy branch predictor implementation that would conventionally first predict backwards branch as taken. Additionally C variant has one branch instruction less for every iteration except for loop preheader. P.s. great videos! Thank you for them!
I don't disagree with anything you said. Different branch prediction algorithms would react to each differently, so I'm not sure either one is optimized for that. Thanks for your comment! The subtleties of these things are really interesting and I love the discussion!
Unfortunately, it isn't that easy! There are way too many other factors that affect the actual run-time. For example, much of the effect I'm talking about here can be overwhelmed by branch-prediction algorithms in the CPU. If you have a loop that runs a zillion times, those algorithms will prevent the flushes because it will correctly guess that the loop will jump to the top. If that speed was critical, I'd have to build both and do an empirical study to be sure who was going to win. Thanks for a great question! I hope you find more videos valuable, too!
@@wizardcraftcode thanks for this clarification, I was just learning about the branch-predication from your CPU pipeline intro. Very grateful for this series!
What made the C assembly look unnecessarily complicated was the lack of formatting. You could have used spaces, better alignment with tabs, and base 10 digits for the purposes of this tutorial.
Interesting point! I posted from a decompiler and didn't notice the inconsistent indentation. Next time, I'll be more careful. Thanks for the feedback!!
The term:
"von Neumann architecture"
is used intermittently and inconsistently in computer science. Most sources that use it have crappy explanations, and most sources with good explanations don't use it.
IBM hired John von Neumann as a consultant in 1951. I was hired in 1978. The entire time I was there I never heard or saw any mention of him or his namesake.
Of course Eckert and Mauchley may have thought of it before he did, but von Neumann got all the credit.
You are absolutely correct! In academia, we use von Neumann architecture really vaguely. It drives me nuts when colleagues call our current multi-core/multi-processor systems "von Neumann machines!" While you were working at IBM, I was building mainframes with Burroughs. We NEVER called our machines von Neumann machines! :D
@@wizardcraftcode "Merlin"
Great name!
Any sufficiently advanced technology is indistinguishable from magic.
A "von Neumann machine" is what von Neumann called a "universal constructor". Beat an academic every chance you get.
Have you checked out Dennis Taylor's Bobiverse? LOL
9:50 Hi! If I'm correct both example c and java loops involve conditional branch on every iteration. The difference is mainly in loop header location(compiled program text-wize) relative to the loop body and hence the direction we jump or not jump when loop condition is true. I believe C strives to satisfy branch predictor implementation that would conventionally first predict backwards branch as taken. Additionally C variant has one branch instruction less for every iteration except for loop preheader.
P.s. great videos! Thank you for them!
I don't disagree with anything you said. Different branch prediction algorithms would react to each differently, so I'm not sure either one is optimized for that. Thanks for your comment! The subtleties of these things are really interesting and I love the discussion!
Very insightful. Thanks Merlin!
Glad it was helpful!
Thank you Merlin for this great tutorial
Thanks! Glad you liked it!
Thanks Merlin...very helpful tutorial !!!
Thanks!
Excellent work.
Thanks!
Very helpful tutorial
Thank you!
Apparently, I replied from the wrong account! Thanks from this one, too!
Does this mean C will perform better than Java for while loops at scale?
Unfortunately, it isn't that easy! There are way too many other factors that affect the actual run-time. For example, much of the effect I'm talking about here can be overwhelmed by branch-prediction algorithms in the CPU. If you have a loop that runs a zillion times, those algorithms will prevent the flushes because it will correctly guess that the loop will jump to the top. If that speed was critical, I'd have to build both and do an empirical study to be sure who was going to win. Thanks for a great question! I hope you find more videos valuable, too!
@@wizardcraftcode thanks for this clarification, I was just learning about the branch-predication from your CPU pipeline intro. Very grateful for this series!
I'm really glad you find them helpful!!!