1 / 8

Lecture 37: Lies My Professor Told Me

CSC 213 – Large Scale Programming. Lecture 37: Lies My Professor Told Me. Big-Oh uh-oh!. Big-Oh complexity not always accurate measure Makes several assumptions when used for analysis End results are valid only when assumptions hold Same cost using any memory in the computer

cicada
Download Presentation

Lecture 37: Lies My Professor Told Me

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. CSC 213 – Large Scale Programming Lecture 37:Lies My Professor Told Me

  2. Big-Oh uh-oh! • Big-Oh complexity not always accurate measure • Makes several assumptions when used for analysis • End results are valid only when assumptions hold • Same cost using any memory in the computer • Makes big-On accurate when costs differ slightly • Minimizes total time when costs differ by a lot

  3. Big-Oh uh-oh! • Big-Oh complexity not always accurate measure • Makes several assumptions when used for analysis • End results are valid only when assumptions hold • Same cost using any memory in the computer • Makes big-On accurate when costs differ slightly • Minimizes total time when costs differ by a lot !=

  4. Big-Oh uh-oh! • Big-Oh complexity not always accurate measure • Makes several assumptions when used for analysis • End results are valid only when assumptions hold • Same cost using any memory in the computer • Makes big-On accurate when costs differ slightly • Minimizes total time when costs differ by a lot !=

  5. Too Far For a Beer? 62.73x 23.17x

  6. Maintaining Your Buzz • Prevent long pauses by maintaining locality • Repeatedly access those objects in fast memory • Access objects in sequential order they are in memory • Both of properties take advantage of caching • Limit data used to size of cache (temporal locality) • (Spatial locality) Exploit knowing how cache works • Limiting data is not easy (or would have done it) • So taking advantage of spatial locality is our best bet

  7. Cache Replacement Algorithms • When we access memory, add its block to cache • May need to evict a block if the cache already full • 2+1 approaches used to select evicted block • FIFOmaintains blocks in Queue and evicts oldest • Track each use and evict block least recently used • (Randomlychoosea block to evict) • For good performance want to avoid worst case • But what is it?

  8. For Next Lecture • Weekly assignments will be available tomorrow • None for this week, but will restart for final week • Program #3 test cases due on Wednesday • Does it work? Important to know this before going on • Portfolio due last day for both video or project • To submit video, must get script to me before then • Reading on (2,4)-trees for Wednesday • If we use trees, how can we improve locality? • Costs of this type of tree being used for Map?

More Related