In this post, we will be recording the results of our sample scaling using the 3 approaches, Naive Algorithm, Lookup-based Algorithm, and Fixed-point Algorithm. We will also analyze the results on which algorithm had the best performance using CPU time as the measurement.
Results
| Naive Algorithm | Lookup-based Algorithm | Fixed-point Algorithm | |||||||
| Wall Clock | 4000 | Wall Clock | 22000 | Wall Clock | 3000 | ||||
| CPU Clock | 4076.95 | CPU Clock | 22375.35 | CPU Clock | 2475.85 | ||||
| Wall Clock | 4000 | Wall Clock | 22000 | Wall Clock | 2000 | ||||
| CPU Clock | 4145.72 | CPU Clock | 22135.35 | CPU Clock | 2475.36 | ||||
| Wall Clock | 4000 | Wall Clock | 22000 | Wall Clock | 3000 | ||||
| CPU Clock | 4077.11 | CPU Clock | 22108.9 | CPU Clock | 2476.09 | ||||
| Wall Clock | 4000 | Wall Clock | 22000 | Wall Clock | 3000 | ||||
| CPU Clock | 4078.33 | CPU Clock | 22167.79 | CPU Clock | 2475.88 | ||||
| Wall Clock | 4000 | Wall Clock | 23000 | Wall Clock | 2000 | ||||
| CPU Clock | 4170.97 | CPU Clock | 22178.86 | CPU Clock | 2475.34 | ||||
| Average | 4109.816 | Average | 22193.25 | Average | 2475.704 |
Analysis – Lookup-based Algorithm
Based on the results of the tests ran, Lookup-based Algorithm had the slowest average run time at 22193.25 seconds. It was 81.48% slower then the Naive Algorithm ((lookupAverage-naiveAverage)/lookupAverage). Also, it was slower then the Fixed-point Algorithm by 88.84% ((lookupAverage-fixedpointAverage)/lookupAverage). This algorithm was the slowest out of the three discussed above.
Analysis – Fixed-point Algorithm
In the results gathered, Fixed-point Algorithm had the fastest average run time at 2475.704 seconds. We already know that Fixed-point Algorithm was faster then Lookup-based Algorithm by 88.84%, but it was also faster then the Naive Algorithm. The difference in run time was 39.76%. Fixed-point Algorithm was the fastest run time out of the three.
Analysis – Naive Algorithm
The Naive Algorithm was not the best, nor was it the worst. It may have not been as fast as Fixed-point Algorithm in terms of Average time to complete the task, but it did relatively good. Naive and Fixed-point had an Average run time of 4.109816 seconds and 2.475704 seconds, respectively. This is only a 1.634112 seconds difference between the two algorithms. Naive Algorithm had a decent run time when compared to the other three algorithms discussed.
Conclusion
In conclusion, Fixed-point Algorithm had the fastest run time, due to its avoidance of converting an int to a double, multiplying the two doubles together, then converting it back to an int. This saves the time by not using the decimal mode embedded in the Aarch64. Naive Algorithm had a decent run time with it almost similar to fixed-point, but it converted the values from int to double then back to int. Both algorithms had to do an multiplying operation for each sample. The Lookup-based Algorithm surprised me the most. Maybe it could be the fact that it had to switch to decimal mode with each operation, but it had the slowest run time. Possibly, if we removed the switching to decimal mode, then creating a table, Lookup-based Algorithm may be faster then the other 2 algorithms.