1.5, due on September 14
Difficult:
I wasn't sure what the 'last' Python operator was. Also, it seems really laborious to go through a program and count FLOPs.
Reflective:
On the other hand, the code optimization tricks were awesome! In particular, I thought it was really interesting that the fact that Python is interpreted causes us to miss out on the compiler optimization for for loops. So that's why Python for loops are so slow! I also thought there were some cool math tricks -- for example, for a value that is added n times, once each cycle, instead you can multiply that value by n outside the for loop and add it just once. Also, Example 1.5.8 was pretty cool, showing that for a while loop, instead of calculating something based on the iterator variable each time, you could solve the expression for the iterator variable, compute the max once, and then compare the iterator value to that max each time.
I wasn't sure what the 'last' Python operator was. Also, it seems really laborious to go through a program and count FLOPs.
Reflective:
On the other hand, the code optimization tricks were awesome! In particular, I thought it was really interesting that the fact that Python is interpreted causes us to miss out on the compiler optimization for for loops. So that's why Python for loops are so slow! I also thought there were some cool math tricks -- for example, for a value that is added n times, once each cycle, instead you can multiply that value by n outside the for loop and add it just once. Also, Example 1.5.8 was pretty cool, showing that for a while loop, instead of calculating something based on the iterator variable each time, you could solve the expression for the iterator variable, compute the max once, and then compare the iterator value to that max each time.
Comments
Post a Comment