Skip to content

GDALRasterBand::ComputeRasterMinMax(): add optimized implementation for Byte and UInt16 data types#5813

Merged
rouault merged 2 commits intoOSGeo:masterfrom
rouault:optimized_minmax
Jun 1, 2022
Merged

GDALRasterBand::ComputeRasterMinMax(): add optimized implementation for Byte and UInt16 data types#5813
rouault merged 2 commits intoOSGeo:masterfrom
rouault:optimized_minmax

Conversation

@rouault
Copy link
Copy Markdown
Member

@rouault rouault commented May 29, 2022

re-use the optimizations of ComputeStatistics(), using SSE2 when available

Before:

$ python perftests/computeminmax.py
testByte(): 8.776
testUInt16(): 7.174
testInt16(): 8.210
testFloat32(): 7.846
testFloat64(): 9.407

After:

$ python perftests/computeminmax.py
testByte(): 0.316
testUInt16(): 0.779
testInt16(): 2.863
testFloat32(): 6.993
testFloat64(): 8.078

To be compared with timings of ComputeStatistics():

$ python ../perftests/computestatistics.py
testByte(): 0.483
testUInt16(): 1.262
testInt16(): 28.417
testFloat32(): 29.075
testFloat64(): 30.382

@rouault rouault added this to the 3.6.0 milestone May 29, 2022
@rouault rouault force-pushed the optimized_minmax branch from f6fb1e9 to 729df4e Compare May 29, 2022 20:43
…or Byte and UInt16 data types

re-use the optimizations of ComputeStatistics(), using SSE2 when available

Before:
```
$ python perftests/computeminmax.py
testByte(): 8.776
testUInt16(): 7.174
testInt16(): 8.210
testFloat32(): 7.846
testFloat64(): 9.407
```

After:
```
$ python perftests/computeminmax.py
testByte(): 0.316
testUInt16(): 0.779
testInt16(): 2.863
testFloat32(): 6.993
testFloat64(): 8.078
```

To be compared with timings of ComputeStatistics():
```
$ python ../perftests/computestatistics.py
testByte(): 0.483
testUInt16(): 1.262
testInt16(): 28.417
testFloat32(): 29.075
testFloat64(): 30.382
```
@rouault rouault force-pushed the optimized_minmax branch from 729df4e to eae3cab Compare May 29, 2022 21:49
@rouault rouault merged commit abdf713 into OSGeo:master Jun 1, 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