Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Speed-up: pass PJ_COORD by reference for fwd4d and inv4d callbacks #3503

Merged
merged 4 commits into from
Dec 12, 2022

Conversation

rouault
Copy link
Member

@rouault rouault commented Dec 11, 2022

(On top of #3502)

Before this PR:

$ bin/bench_proj_trans --pipeline "+proj=pipeline +step +proj=unitconvert +xy_in=deg +xy_out=rad +step +proj=merc" 2 49
2 49 -> 222638.981586547 6242595.99979511
Duration: 739 ms
Throughput: 6.77 million coordinates/s

$ bin/bench_proj_trans --pipeline "+proj=pipeline +step +proj=unitconvert +xy_in=deg +xy_out=rad" 2 49
2 49 -> 0.0349065850398866 0.855211333477221
Duration: 146 ms
Throughput: 34.25 million coordinates/s

With this PR:

$ bin/bench_proj_trans --pipeline "+proj=pipeline +step +proj=unitconvert +xy_in=deg +xy_out=rad +step +proj=merc" 2 49
2 49 -> 222638.981586547 6242595.99979511
Duration: 599 ms
Throughput: 8.35 million coordinates/s

$ bin/bench_proj_trans --pipeline "+proj=pipeline +step +proj=unitconvert +xy_in=deg +xy_out=rad" 2 49
2 49 -> 0.0349065850398866 0.855211333477221
Duration: 81 ms
Throughput: 61.73 million coordinates/s

The dynamic_cast<> introduced in 718e074 (was
also backported in 9.1.1) can be a performance killer for pipelines that
are not very computational heavy.

Before this fix:

```
$ bin/bench_proj_trans --pipeline "+proj=pipeline +step +proj=unitconvert +xy_in=deg +xy_out=rad +step +proj=merc" 2 49
2 49 -> 222638.981586547 6242595.99979511
Duration: 877 ms
Throughput: 5.70 million coordinates/s

$ bin/bench_proj_trans --pipeline "+proj=pipeline +step +proj=unitconvert +xy_in=deg +xy_out=rad" 2 49
2 49 -> 0.0349065850398866 0.855211333477221
Duration: 276 ms
Throughput: 18.12 million coordinates/s
```

After this fix:
```
$ bin/bench_proj_trans --pipeline "+proj=pipeline +step +proj=unitconvert +xy_in=deg +xy_out=rad +step +proj=merc" 2 49
2 49 -> 222638.981586547 6242595.99979511
Duration: 739 ms
Throughput: 6.77 million coordinates/s

$ bin/bench_proj_trans --pipeline "+proj=pipeline +step +proj=unitconvert +xy_in=deg +xy_out=rad" 2 49
2 49 -> 0.0349065850398866 0.855211333477221
Duration: 146 ms
Throughput: 34.25 million coordinates/s
```
…em directly in pipeline_forward/inverse_4d()
@rouault rouault added this to the 9.2.0 milestone Dec 11, 2022
@rouault rouault merged commit abf1904 into OSGeo:master Dec 12, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant