wtime_test 20-Jan-2019 11:04:37 WTIME_TEST MATLAB version. Test the WTIME library. TEST01 Time the RAND function: x = rand ( n, 1 ); Data vectors will be of minimum size 1024 Data vectors will be of maximum size 1048576 Number of repetitions of the operation: 5 Timing results: Vector Size Rep #1 Rep #2 Rep #3 Rep #4 Rep #5 1024 0.000654 0.000050 0.000010 0.000020 0.000020 2048 0.000121 0.000161 0.000020 0.000020 0.000020 4096 0.000282 0.000030 0.000030 0.000020 0.000030 8192 0.000060 0.000040 0.000050 0.000050 0.000040 16384 0.000262 0.000080 0.000091 0.000091 0.000091 32768 0.000302 0.000171 0.000181 0.000171 0.000191 65536 0.000513 0.000342 0.000352 0.000332 0.000342 131072 0.000986 0.000815 0.000684 0.000734 0.000674 262144 0.002183 0.001418 0.001529 0.001378 0.001338 524288 0.004094 0.002726 0.002846 0.002726 0.002665 1048576 0.008218 0.005452 0.005431 0.005431 0.005341 20-Jan-2019 11:04:37 TEST02 Time vectorized operations: y(1:n) = x(1:n) y(1:n) = PI * x(1:n) ) y(1:n) = sqrt ( x(1:n) ) y(1:n) = exp ( x(1:n) ) Data vectors will be of minimum size 4096 Data vectors will be of maximum size 4194304 Number of repetitions of the operation: 5 Timing results: Vector Size Rep #1 Rep #2 Rep #3 Rep #4 Rep #5 4096 0.000251 0.000030 0.000020 0.000030 0.000020 8192 0.000111 0.000272 0.000010 0.000020 0.000020 16384 0.000070 0.000030 0.000020 0.000020 0.000030 32768 0.000091 0.000151 0.000050 0.000050 0.000050 65536 0.000684 0.000241 0.000091 0.000080 0.000080 131072 0.000875 0.000624 0.000161 0.000221 0.000161 262144 0.001509 0.001187 0.000412 0.000342 0.000332 524288 0.003380 0.000734 0.000744 0.000815 0.000744 1048576 0.007936 0.001810 0.002233 0.001730 0.001992 2097152 0.014313 0.004587 0.003832 0.003802 0.003832 4194304 0.032116 0.010390 0.011406 0.010189 0.010571 Timing results: Vector Size Rep #1 Rep #2 Rep #3 Rep #4 Rep #5 4096 0.003048 0.000020 0.000020 0.000020 0.000020 8192 0.000131 0.000030 0.000040 0.000040 0.000040 16384 0.000060 0.000060 0.000080 0.000101 0.000070 32768 0.000091 0.000111 0.000101 0.000101 0.000101 65536 0.000563 0.000161 0.000141 0.000141 0.000151 131072 0.000392 0.000241 0.000241 0.000282 0.000231 262144 0.000503 0.000463 0.000443 0.000453 0.000543 524288 0.001710 0.000966 0.000905 0.000905 0.000915 1048576 0.002655 0.002213 0.002183 0.002293 0.002183 2097152 0.004748 0.004898 0.004848 0.004858 0.004929 4194304 0.012955 0.012593 0.012472 0.012412 0.012432 Timing results: Vector Size Rep #1 Rep #2 Rep #3 Rep #4 Rep #5 4096 0.000503 0.000030 0.000030 0.000030 0.000030 8192 0.016978 0.000070 0.000080 0.000101 0.000070 16384 0.000131 0.000121 0.000121 0.000131 0.000131 32768 0.000141 0.000111 0.000111 0.000121 0.000121 65536 0.000603 0.000181 0.000171 0.000171 0.000171 131072 0.000322 0.000302 0.000292 0.000292 0.000292 262144 0.000865 0.000593 0.000603 0.000593 0.000593 524288 0.001257 0.001227 0.001227 0.001217 0.001388 1048576 0.002716 0.002746 0.002665 0.002655 0.002746 2097152 0.006498 0.006820 0.006467 0.006528 0.006538 4194304 0.018407 0.015037 0.015510 0.015188 0.014886 Timing results: Vector Size Rep #1 Rep #2 Rep #3 Rep #4 Rep #5 4096 0.006286 0.000091 0.000101 0.000101 0.000101 8192 0.000131 0.000040 0.000040 0.000040 0.000040 16384 0.000211 0.000131 0.000131 0.000141 0.000111 32768 0.000272 0.000181 0.000201 0.000191 0.000191 65536 0.001740 0.000312 0.000302 0.000312 0.000312 131072 0.000935 0.000553 0.000553 0.000563 0.000573 262144 0.001086 0.001076 0.001066 0.001076 0.001076 524288 0.002173 0.002243 0.002152 0.002183 0.002233 1048576 0.004868 0.004506 0.004516 0.004476 0.004546 2097152 0.009314 0.009234 0.009103 0.009073 0.009163 4194304 0.021132 0.021283 0.021505 0.021746 0.021092 20-Jan-2019 11:04:39 TEST03 Time unvectorized operations: for i = 1 : n y(i) = x(i) y(i) = PI * x(i) ) y(i) = sqrt ( x(i) ) y(i) = exp ( x(i) ) end Data vectors will be of minimum size 4096 Data vectors will be of maximum size 4194304 Number of repetitions of the operation: 5 Timing results: Vector Size Rep #1 Rep #2 Rep #3 Rep #4 Rep #5 4096 0.000654 0.000020 0.000010 0.000020 0.000020 8192 0.000101 0.000262 0.000020 0.000010 0.000020 16384 0.000131 0.000121 0.000020 0.000020 0.000020 32768 0.000272 0.000231 0.000050 0.000040 0.000040 65536 0.001066 0.000443 0.000091 0.000091 0.000101 131072 0.000925 0.000895 0.000181 0.000171 0.000171 262144 0.002515 0.001780 0.000362 0.000443 0.000362 524288 0.006417 0.000744 0.000724 0.000724 0.000704 1048576 0.007614 0.001469 0.001458 0.001479 0.001428 2097152 0.002997 0.002846 0.002967 0.003088 0.002977 4194304 0.006115 0.005955 0.005975 0.005834 0.005934 Timing results: Vector Size Rep #1 Rep #2 Rep #3 Rep #4 Rep #5 4096 0.000704 0.000010 0.000020 0.000020 0.000020 8192 0.000101 0.000010 0.000010 0.000020 0.000010 16384 0.000131 0.000020 0.000030 0.000030 0.000020 32768 0.000322 0.000060 0.000050 0.000050 0.000050 65536 0.000714 0.000101 0.000101 0.000091 0.000101 131072 0.000986 0.000201 0.000201 0.000191 0.000201 262144 0.002414 0.000402 0.000392 0.000382 0.000392 524288 0.000815 0.000785 0.000865 0.000855 0.000764 1048576 0.001599 0.001599 0.001650 0.001579 0.001539 2097152 0.003289 0.003188 0.003712 0.003148 0.003158 4194304 0.006548 0.006286 0.006397 0.006437 0.006367 Timing results: Vector Size Rep #1 Rep #2 Rep #3 Rep #4 Rep #5 4096 0.000674 0.000030 0.000030 0.000030 0.000030 8192 0.000151 0.000030 0.000030 0.000030 0.000030 16384 0.000221 0.000060 0.000111 0.000060 0.000070 32768 0.000402 0.000131 0.000211 0.000131 0.000151 65536 0.001056 0.000251 0.000251 0.000241 0.000241 131072 0.001992 0.000845 0.000835 0.000815 0.000473 262144 0.003641 0.001730 0.000966 0.001690 0.000945 524288 0.003309 0.003480 0.002092 0.003370 0.001951 1048576 0.003933 0.003963 0.003933 0.006960 0.003782 2097152 0.007835 0.007765 0.007946 0.007624 0.007644 4194304 0.015711 0.016003 0.015279 0.015389 0.015389 Timing results: Vector Size Rep #1 Rep #2 Rep #3 Rep #4 Rep #5 4096 0.002917 0.000070 0.000050 0.000060 0.000060 8192 0.000211 0.000101 0.000091 0.000101 0.000101 16384 0.000372 0.000191 0.000191 0.000201 0.000191 32768 0.000825 0.000382 0.000392 0.000382 0.000382 65536 0.004486 0.000764 0.000764 0.000764 0.000764 131072 0.001640 0.001519 0.001549 0.001529 0.001579 262144 0.003118 0.003148 0.003048 0.003058 0.003048 524288 0.006528 0.006095 0.006176 0.006136 0.006176 1048576 0.015580 0.012362 0.012412 0.012271 0.012352 2097152 0.024864 0.024794 0.024995 0.024552 0.024794 4194304 0.049185 0.050030 0.049457 0.049316 0.049034 20-Jan-2019 11:04:41 TEST04 Time the 2D nearest neighbor problem. Given X(2,N) and Y(2), find X(2,*) closest to Y(2). for i = 1 : n if distance ( x(2,i), y ) < minimum so far x_min = x(2,i) end Data vectors will be of minimum size 1024 Data vectors will be of maximum size 1048576 Number of repetitions of the operation: 5 Timing results: Vector Size Rep #1 Rep #2 Rep #3 Rep #4 Rep #5 1024 0.004174 0.000000 0.000010 0.000010 0.000010 2048 0.000141 0.000191 0.000000 0.000000 0.000000 4096 0.000241 0.000060 0.000010 0.000010 0.000010 8192 0.000181 0.000121 0.000020 0.000020 0.000020 16384 0.000533 0.000241 0.000040 0.000040 0.000040 32768 0.000523 0.000483 0.000080 0.000080 0.000080 65536 0.001046 0.000945 0.000161 0.000151 0.000151 131072 0.000493 0.001921 0.000322 0.000302 0.000302 262144 0.000644 0.003752 0.000634 0.000624 0.000624 524288 0.001358 0.001247 0.001227 0.001237 0.001227 1048576 0.002655 0.002545 0.002515 0.002464 0.002474 20-Jan-2019 11:04:41 TEST05 Time the matrix multiplication problem. Compute C = A * B where A is an L by M matrix, B is an M by N matrix, and so C is an L by N matrix. Minimum value of L = M = N = 4 Maximum value of L = M = N = 1024 Number of repetitions of the operation: 5 Use triple loop for matrix multiplication. Timing results using nested loops: Vector Size Rep #1 Rep #2 Rep #3 Rep #4 Rep #5 4 0.003118 0.000191 0.000000 0.000010 0.000010 16 0.000433 0.000251 0.000010 0.000010 0.000010 64 0.004506 0.003631 0.000704 0.000704 0.000724 256 0.095664 0.094739 0.068829 0.069000 0.071182 Use C = A * B matrix multiplication. Timing results using C = A * B: Vector Size Rep #1 Rep #2 Rep #3 Rep #4 Rep #5 4 0.039107 0.000221 0.000000 0.000000 0.000010 16 0.000040 0.000010 0.000010 0.000000 0.000000 64 0.015470 0.000030 0.000020 0.000020 0.000010 256 0.000362 0.000191 0.000191 0.000201 0.000201 WTIME_TEST Normal end of execution. 20-Jan-2019 11:04:41 diary off