1 / 4

CSE 341 Programming Languages Performance Patterns, Macros

CSE 341 Programming Languages Performance Patterns, Macros. Zach Tatlock Spring 2014.

jacqui
Download Presentation

CSE 341 Programming Languages Performance Patterns, Macros

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. CSE 341 Programming LanguagesPerformance Patterns, Macros Zach Tatlock Spring 2014

  2. When I was a novice programmer, I spent many hours trying to "speed up" my code. One day, after many agonizing attempts at this feat, my mentor approached and asked how things were going. Upon hearing of my troubles, he imparted this sage wisdom: "The CPU," he said, "runs at a certain speed. It can execute a fixed number of instructions per second, and no more. There is a finite limit to how many instructions per second it can execute.” "So there is no way, really, to make code go faster, because there is no way to make instructions execute faster. There is only such a thing as making the machine do less." He paused for emphasis. "To go fast," he said slowly, "do less."

  3. Optimization The 1st rule of optimization: Don’t do it. The 2nd rule of optimization(experts only): Don’t do it … yet.

  4. Optimization Seriously, only optimize with profile in hand. Otherwise, two very nasty consequences: 1. time wasted - life is short! 2. code unnecessarily complex - need more beauty in the world YOLO

More Related