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

GeoTIFF grid reading: perf improvements (fixes #2785) #2787

Merged
merged 3 commits into from
Jul 23, 2021

Conversation

rouault
Copy link
Member

@rouault rouault commented Jul 22, 2021

With this commit, and the 2 previous ones, given mytest.cpp


int main()
{
    PJ* pj = proj_create(nullptr, "+proj=vgridshift +grids=us_nga_egm96_15.tif");
    for( int i = 0; i < 5*1000*1000; i++)
    {
        PJ_COORD coord;
        coord.lpz.lam = 0;
        coord.lpz.phi = 0;
        coord.lpz.z = 0;
        proj_trans(pj, PJ_FWD, coord);
    }
    return 0;
}

we get a x2 speedup

Before:

$ PROJ_LIB=data:$HOME/proj/PROJ-data/us_nga LD_LIBRARY_PATH=src/.libs  hyperfine --warmup 1 'taskset -c 11 ./mytest'
Benchmark #1: taskset -c 11 ./mytest
  Time (mean ± σ):      1.950 s ±  0.014 s    [User: 1.945 s, System: 0.005 s]
  Range (min … max):    1.937 s …  1.971 s

After:

$ PROJ_LIB=data:$HOME/proj/PROJ-data/us_nga LD_LIBRARY_PATH=src/.libs  hyperfine --warmup 1 'taskset -c 11 ./mytest'
Benchmark #1: taskset -c 11 ./mytest
  Time (mean ± σ):     984.4 ms ±   3.1 ms    [User: 977.0 ms, System: 7.2 ms]
  Range (min … max):   979.3 ms … 990.5 ms

@rouault rouault force-pushed the vgrid_perf_improvements branch from 6ed44d5 to a414fa7 Compare July 22, 2021 21:17
With this commit, and the 2 previous ones, given mytest.cpp
```

int main()
{
    PJ* pj = proj_create(nullptr, "+proj=vgridshift +grids=us_nga_egm96_15.tif");
    for( int i = 0; i < 5*1000*1000; i++)
    {
        PJ_COORD coord;
        coord.lpz.lam = 0;
        coord.lpz.phi = 0;
        coord.lpz.z = 0;
        proj_trans(pj, PJ_FWD, coord);
    }
    return 0;
}
```

we get a x2 speedup

Before:
```
$ PROJ_LIB=data:$HOME/proj/PROJ-data/us_nga LD_LIBRARY_PATH=src/.libs  hyperfine --warmup 1 'taskset -c 11 ./mytest'
Benchmark #1: taskset -c 11 ./mytest
  Time (mean ± σ):      1.950 s ±  0.014 s    [User: 1.945 s, System: 0.005 s]
  Range (min … max):    1.937 s …  1.971 s
```

After:
```
$ PROJ_LIB=data:$HOME/proj/PROJ-data/us_nga LD_LIBRARY_PATH=src/.libs  hyperfine --warmup 1 'taskset -c 11 ./mytest'
Benchmark #1: taskset -c 11 ./mytest
  Time (mean ± σ):     984.4 ms ±   3.1 ms    [User: 977.0 ms, System: 7.2 ms]
  Range (min … max):   979.3 ms … 990.5 ms
```
@rouault rouault force-pushed the vgrid_perf_improvements branch from a414fa7 to a871ada Compare July 22, 2021 21:42
@rouault rouault merged commit 2656c29 into OSGeo:master Jul 23, 2021
github-actions bot pushed a commit that referenced this pull request Jul 23, 2021
GeoTIFF grid reading: perf improvements (fixes #2785)
a0x8o added a commit to a0x8o/PROJ that referenced this pull request Jul 23, 2021
GeoTIFF grid reading: perf improvements (fixes OSGeo#2785)
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