Version 3 (modified by 14 years ago) (diff) | ,
---|
Distance Calculation Comparison
This is a comparison between the two methods of distance calculations in OpenSHA.
The two options (both in LocationUtils.java are linearDistance (referred to as "slow") and linearDistanceFast (referred to as "fast").
Test conducted with this class: trunk/dev/scratch/kevin/DistSpeedTest.java
Test Results
- Distance calculations: 5000000
- Distance range: 0.001 KM -> 5000 KM, 0.001 KM increments from starting location with azimuth of 45 degrees.
- Total times
- Fast: 5463 milis = 5.463 secs (0.0010926 milis/calc)
- Slow: 7410 milis = 7.410 secs (0.001482 milis/calc)
- Speedup: 1.356397583745195 x
distance | dist delta (fast - slow) | percent difference |
50 KM | 1.28E-04 KM | 2.57E-04 % |
100 KM | 0.001026994 KM | 0.001027005 % |
200 KM | 0.008215952 KM | 0.004108145 % |
500 KM | 0.128369704 KM | 0.025680531 % |
1000 KM | 1.026777967 KM | 0.102783287 % |
2000 KM | 8.207860832 KM | 0.412083308 % |
3000 KM | 27.66526207 KM | 0.930752669 % |
4000 KM | 65.46170846 KM | 1.663744154 % |
5000 KM | 127.6116548 KM | 2.61896699 % |
Charts
Total cumulative calculation time over iterations
Distance delta (fast distance - slow distance) vs calculation distance
Percent difference between fast and slow methods vs calculation distance
Attachments (4)
-
dist_calc_comparison.xlsx (32.4 KB) - added by 14 years ago.
Comparison Excel Sheet
- dist_calc_time_chart.png (9.4 KB) - added by 14 years ago.
- fast_minus_slow_chart.png (11.0 KB) - added by 14 years ago.
- percent_diff_chart.png (10.4 KB) - added by 14 years ago.
Download all attachments as: .zip