BoostGSoC18 / geometry

Boost.Geometry - Generic Geometry Library
http://boost.org/libs/geometry
0 stars 1 forks source link

Performance benchmarks #3

Open adl1995 opened 6 years ago

adl1995 commented 6 years ago

Listed below are some performance benchmarks for the following methods:

Compiler used: g++ (version 7.2.0) Optimization level: O3

The execution times are calculated using the Boost Chrono library. I created a separate .cpp file for each method, otherwise, I was getting similar execution times when all methods were placed in a single file. The code for a single file is available on GitHub. I used this Makefile for compiling all .cpp files. The dataset associated with GeographicLib is used (https://zenodo.org/record/32156).

Direct methods

Table 1

First 100K entries, i.e. the points randomly distributed on the ellipsoid.

Method Time (seconds)
Karney (order 1) 0.742535
Karney (order 2) 0.778593
Karney (order 3) 0.760253
Karney (order 4) 0.759539
Karney (order 5) 0.751717
Karney (order 6) 0.76962
Karney (order 7) 0.775933
Karney (order 8) 0.781861
Vincenty 0.835348
Thomas (order 1) 0.834416
Thomas (order 2) 0.862714

Table 2

First 200K entries, i.e. the points randomly distributed on the ellipsoid.

Method Time (seconds)
Karney (order 1) 1.44966
Karney (order 2) 1.46227
Karney (order 3) 1.46714
Karney (order 4) 1.47369
Karney (order 5) 1.48329
Karney (order 6) 1.58164
Karney (order 7) 1.51181
Karney (order 8) 1.52453
Vincenty 1.60484
Thomas (order 1) 1.59485
Thomas (order 2) 1.60706

Table 3

For 1e6 iterations. Comparison is done for the following input:

lon1=0., lat1=47.565626644319, s12=865.0302904, azi1=109.645188791724
Method lon2 lat2 azi2 Time (seconds)
Karney (order 1) 0.01080725671 47.56301492 109.6531649 0.842479958
Karney (order 2) 0.01082583273 47.56301043 109.6531786 0.934280867
Karney (order 3) 0.01082581511 47.56301043 109.6531786 0.946098476
Karney (order 4) 0.0108258151 47.56301043 109.6531786 1.020440514
Karney (order 5) 0.0108258151 47.56301043 109.6531786 1.026539299
Karney (order 6) 0.0108258151 47.56301043 109.6531786 1.149418505
Karney (order 7) 0.0108258151 47.56301043 109.6531786 1.156282074
Karney (order 8) 0.0108258151 47.56301043 109.6531786 1.27542
Vincenty 0.0001889553612 47.56558099 109.6453283 1.156431093
Thomas (order 1) 0.0001889553612 47.56558099 109.6453283 1.207880594
Thomas (order 2) 0.0001889553611 47.56558099 109.6453283 1.229166743
adl1995 commented 6 years ago

Inverse methods

Table 1

First 100K entries from GeographicLib dataset, i.e. the points randomly distributed on the ellipsoid.

Method Time (seconds)
Karney (order 1) 0.855704
Karney (order 2) 0.866872
Karney (order 3) 0.866104
Karney (order 4) 0.878759
Karney (order 5) 0.894176
Karney (order 6) 0.921662
Karney (order 7) 0.950012
Karney (order 8) 0.986667
Vincenty 0.800606
Thomas 0.779644
Andoyer 0.775397

Table 2

First 200K entries from GeographicLib dataset, i.e. the points randomly distributed on the ellipsoid.

Method Time (seconds)
Karney (order 1) 1.65711
Karney (order 2) 1.64782
Karney (order 3) 1.66457
Karney (order 4) 1.6728
Karney (order 5) 1.70661
Karney (order 6) 1.7836
Karney (order 7) 1.81258
Karney (order 8) 1.87114
Vincenty 1.54708
Thomas 1.56293
Andoyer 1.49774

Table 3

For 1e6 iterations. Comparison is done for the following input:

lon1=0., lat1=47.565626644319, lon2=0.010825815107066166, lat2=47.563010432984462575
Method Distance Azimuth Reverse azimuth Time (seconds)
Karney (order 1) 865.0312267 109.6451634 109.6531532 1.172777374
Karney (order 2) 865.0302901 109.6451888 109.6531786 0.967596135
Karney (order 3) 865.0302906 109.6451888 109.6531786 0.968770456
Karney (order 4) 865.0302906 109.6451888 109.6531786 1.070992266
Karney (order 5) 865.0302906 109.6451888 109.6531786 1.078476219
Karney (order 6) 865.0302906 109.6451888 109.6531786 1.270175515
Karney (order 7) 865.0302906 109.6451888 109.6531786 1.334728774
Karney (order 8) 865.0302906 109.6451888 109.6531786 1.607816596
Vincenty 865.0302905 109.6451887 109.6531786 0.660409948
Thomas 865.0302877 109.6451889 109.6531787 0.679921994
Andoyer 865.0293549 109.6453179 109.6533078 0.481107833

@vissarion, @awulkiew - I think Karney's inverse method still needs to be further optimized. I will try to do so in the next days. If you have time, please review the code in #500.

adl1995 commented 6 years ago

Inverse methods

The table below lists the average absolute error (in meters) for inverse methods. The error is merely the difference between the expected distance and the obtained distance, averaged over all runs. The successive cells contain the execution time (in seconds).

The entries are taken from GeographicLib dataset. There are 50,000 entries for each category.

Methods Short distances (< 1 km) Time Equatorial Time Meridional Time Antipodal Time
Karney (order 1) 0.00025042 0.391322 1.42778e-07 0.457543 7.0822 0.423475 7.90664 0.436023
Karney (order 2) 5.20013e-07 0.386201 1.18204e-09 0.423153 0.00466075 0.402592 0.009649 0.436813
Karney (order 3) 5.80503e-08 0.421666 1.15488e-09 0.447898 1.78157e-06 0.415197 7.62464e-06 0.434025
Karney (order 4) 5.80797e-08 0.389778 1.15438e-09 0.430886 2.41325e-09 0.393773 5.87403e-06 0.450385
Karney (order 5) 5.80791e-08 0.389441 1.15375e-09 0.437456 1.06278e-09 0.404054 5.87576e-06 0.446446
Karney (order 6) 5.80777e-08 0.393696 1.15375e-09 0.450913 1.06298e-09 0.405456 5.87615e-06 0.459213
Karney (order 7) 5.80755e-08 0.442452 1.15375e-09 0.471292 1.06299e-09 0.412917 5.87622e-06 0.471133
Karney (order 8) 5.80744e-08 0.411889 1.15375e-09 0.499302 1.06299e-09 0.427433 5.87638e-06 0.490337
Vincenty 2.45125e-05 0.394257 1.38506e-07 0.365613 5.24392e+06 0.396482 3.97689e+06 0.404575
Thomas 4.70267e-07 0.394738 2.41539e-06 0.429896 5.24418e+06 0.394133 3.99292e+06 0.389941
Andoyer 0.00293368 0.362629 1.0884e-06 0.36627 6.27431e+06 0.379274 2.7527e+06 0.389984
Pranay711 commented 3 years ago

i m beginner to this. pls suggest me how to get started. @adl1995

adl1995 commented 3 years ago

@Pranay711 - If you're asking how to started with GSoC, probably searching for past project is a good start (https://summerofcode.withgoogle.com/archive/2020/organizations/6585514028695552). (Note that projects for GSoC 2021 haven't been announced yet.)

Pranay711 commented 3 years ago

sir, i m new one to open source. how can start my journey for gsoc? i saw projects. should i have visit code of that project? plss suggest me some steps for starting.

On Sun, Nov 1, 2020 at 3:37 PM Adeel Ahmad notifications@github.com wrote:

@Pranay711 https://github.com/Pranay711 - If you're asking how to started with GSoC, probably searching for past project is a good start ( https://summerofcode.withgoogle.com/archive/2020/organizations/6585514028695552). (Note that projects for GSoC 2021 haven't been announced yet.)

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/BoostGSoC18/geometry/issues/3#issuecomment-720063551, or unsubscribe https://github.com/notifications/unsubscribe-auth/AQ6S7C5AW2E7GYUSBL2WDUDSNUXPLANCNFSM4FNJB4LA .