diff options
| author | Even Rouault <even.rouault@spatialys.com> | 2020-03-09 14:57:21 +0100 |
|---|---|---|
| committer | Even Rouault <even.rouault@spatialys.com> | 2020-03-09 15:12:12 +0100 |
| commit | d0d422dffc6549d168294dc252ebc4d58a2e9e86 (patch) | |
| tree | 025c5ab6db05bd0bb278f9dd23bd4ff4526581c0 /docs/source/development/reference | |
| parent | 13782b19974ed8c99a8176692e688512c96e8481 (diff) | |
| download | PROJ-d0d422dffc6549d168294dc252ebc4d58a2e9e86.tar.gz PROJ-d0d422dffc6549d168294dc252ebc4d58a2e9e86.zip | |
Extended tmerc (Poder/Engsager): speed optimizations
fwd: 52% faster on Core-i7@2.6GHz, 40% faster on GCE Xeon@2GHz
inv: 24% faster on Core-i7@2.6GHz, 36% faster on GCE Xeon@2GHz
Those speed-ups are obtained due to elimination of a number of
transcendental functions (atan, sincos, cosh, sinh), through the
use of usual trigonometric/hyperbolic formulas.
The numeric results before/after seem identical at worse up to
14 decimal digits, which is way beyond the apparent accuracy of the
computations
On a point, far from central meridian, where round-tripping is not so great:
Before:
echo "81 1" | src/proj -d 18 +proj=utm +zone=31 | src/proj -d 18 -I +proj=utm +zone=31
80.999994286593448578 0.999987970918421620
After:
$ echo "81 1" | src/proj -d 18 +proj=utm +zone=31 | src/proj -d 18 -I +proj=utm +zone=31
80.999994286593448578 0.999987970918422175
The benchmarking program used is:
```
#include "proj.h"
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
int main(int argc, char* argv[])
{
if( argc != 3 ) {
fprintf(stderr, "Usage: bench quoted_proj_string fwd/inv\n");
exit(1);
}
PJ* p = proj_create(0, argv[1]);
const int dir = strcmp(argv[2], "inv") == 0 ? PJ_INV : PJ_FWD;
PJ_COORD coord;
if( dir == PJ_FWD )
{
coord.xy.x = 0.5; // rad
coord.xy.y = 0.5; // rad
}
else
{
coord.xy.x = 450000; // m
coord.xy.y = 5000000; // m
}
for(int i = 0; i < 40 * 1000* 1000; i++)
proj_trans(p, dir, coord);
proj_destroy(p);
return 0;
}
```
Diffstat (limited to 'docs/source/development/reference')
0 files changed, 0 insertions, 0 deletions
