Académique Documents
Professionnel Documents
Culture Documents
Short description
To make a benchmark for CPU means to run a set of programs or other
operations in order to assess the relative performance of the CPU, normally by
running a number of standard tests and trials against it.
It is always important to run many iterations of a benchmark. Timings will
change and an average of all iterations should be used to provide a more
accurate picture for comparisons.
2. Prime Numbers
The Prime Number Test aims to test how fast the CPU can search for Prime
numbers, reported as operations per second. A prime number is a number that
can only be divided by itself and 1. For example, 1, 2, 3, 5, 7, 11 etc. This
algorithm uses loops and CPU operations that are common in computer software,
the most intensive being multiplication and modulo operations. All operations are
performed using 64-bit integers. The specific formula used for this test is
the Sieve of Atkin with a limit of 32 million.
Algorithms
1. Quicksort for string sorting test
Quicksort is a divide and conquer algorithm. Quicksort first divides a large array into two smaller
sub-arrays: the low elements and the high elements. Quicksort can then recursively sort the subarrays.
The steps are:
1. Pick an element, called a pivot, from the array.
2. Partitioning: reorder the array so that all elements with values less than the pivot come
before the pivot, while all elements with values greater than the pivot come after it (equal
values can go either way). After this partitioning, the pivot is in its final position.
3. Recursively apply the above steps to the sub-array of elements with smaller values and
separately to the sub-array of elements with greater values.
5. Take the next number in the sieve list still marked prime.
6. Include the number in the results list.
7. Square the number and mark all multiples of that square as non prime. Note that the
multiples that can be factored by 2, 3, or 5 need not be marked, as these will be ignored
in the final enumeration of primes.
8. Repeat steps four through seven.
Diagrams
1. Use case diagram
2. Class diagram
Reference
http://www.embedded.com/design/other/4212735/CoreMark--A-realistic-way-tobenchmark-CPU-performance
https://en.wikipedia.org/wiki/Streaming_SIMD_Extensions
https://en.wikipedia.org/wiki/Quicksort
https://en.wikipedia.org/wiki/Sieve_of_Atkin