Presentation is loading. Please wait.

Presentation is loading. Please wait.

The need for speed. Aren’t today’s computers fast enough? Justification for Better Performance complex applications text  graphics  video real-time.

Similar presentations


Presentation on theme: "The need for speed. Aren’t today’s computers fast enough? Justification for Better Performance complex applications text  graphics  video real-time."— Presentation transcript:

1 The need for speed

2 Aren’t today’s computers fast enough? Justification for Better Performance complex applications text  graphics  video real-time applications computational science

3 How do we create faster computation? 1) Faster Hardware 2) Faster Algorithms

4 How to achieve Moore’s Law? 1)Miniaturization 3) Different technologies limitations: manufacturing & speed of light optical computers? biological computers? 2) Multiple processors (supercomputers) quantum computers?

5 Algorithm speed can be estimated by counting...the number of instructions executed...the number of variable/memory assignments...the number of data comparisons A benchmark is a program execution used to measure execution time. (a single experimental result) Benchmarks are one way to analyze algorithms. empirical approach analytic approach How would you know which algorithm is faster?

6 Counting the Cost Recall linear search & binary search Number of items Worst CaseExpected Case Number of probes (comparisons) LinearBinary Linear Binary 11111 7733.53 63 8318 1000 1050010 NNlog 2 NN/2log 2 N Note that 1000 processors could search 1000 items with a single probe per processor.

7 Algorithm to find the maximum Consider 8 numbers. abcdefgh max of a & b max of c & d max of e & f max of g & h max of a - d max of e - h max of a - h comparisons Total number of comparisons?

8 Algorithm to find the maximum What about 7 numbers. abcdefg max of a & b max of c & d max of e & f max of a - d max of e - g max of a - g Total number of comparisons?

9 Algorithm to find the maximum What about 6 numbers. abcdef max of a & b max of c & d max of e & f max of a - d max of a - f Total number of comparisons?

10 Algorithm to find the maximum The performance of this algorithm is similar to the linear search. Number of items Number of comparisons 10 21 65 76 87 2019 10099 NN-1 However, using many processors doesn’t help as much for the maximum finder algorithm.

11 Sorting Algorithms Sorting algorithms rearrange items from smallest to largest (or largest to smallest). One sorting algorithm: - repeatedly find the maximum and move it immediately ahead of all prior maximums. Example (sort 100 values) Step 1 - find the maximum of 100 values 99 comparisons Step 2 - find the maximum of 99 values 98 comparisons Step 3 - find the maximum of 98 values 97 comparisons Total comparisons for sorting 100: 99+98+97+...+1 Total comparisons for sorting N: (N-1)+(N-2)+(N-3)+...+1 = N*(N-1) 2

12 Comparing Algorithm Performance binary search linear search sorting algorithm

13 Are there slower algorithms? Consider an algorithm to crack your password. One such algorithm attempts every possible keystroke. Analysis Password lengthComparisons 1 94 2 94*94 = 8,836 3 94*94*94 = 830,584 8 94 8 = 6 x 10 11 N 94 N......

14 Comparing Algorithm Performance password cracker other algorithms

15 Functional Growth 10194 421678074896 83646 x 10 11 123.6144(note 1) 164256(note 2) 204.3400 244.6576 284.8784 3251024 nlog 2 nn2n2 94 n note 1 - roughly five years of computation for a 1 petaflop supercomputer note 2 - about 5 times the age of the universe linear search binary search sort password cracker not practical for any large number of items

16 Important Results #1 -- There are algorithms that take too long to be practically executed on a computer. #2 -- These slow algorithms tend of be of the type that attempt a brute force approach of attempting all possible combinations. #3 -- Moore’s Law cannot fix the problem.

17 So what do we know? Many algorithms can be processed by modern computers. Some algorithms will be processed with faster computers. Computers will never be fast enough for some algorithms.


Download ppt "The need for speed. Aren’t today’s computers fast enough? Justification for Better Performance complex applications text  graphics  video real-time."

Similar presentations


Ads by Google