Because fast and efficient serial processing of raster-graphic images and other two-dimensional arrays is a requirement in land-change modeling and other applications, the effects of 10 factors on the runtimes for processing two-dimensional arrays with C and C++ are evaluated in a comparative factorial study. This study’s factors include the choice among three C or C++ source-code techniques for array processing; the choice of Microsoft Windows 7 or a Linux operating system; the choice of 4-byte or 8-byte array elements and indexes; and the choice of 32-bit or 64-bit memory addressing. This study demonstrates how programmer choices can reduce runtimes by 75 percent or more, even after compiler optimizations. Ten points of practical advice for faster processing of two-dimensional arrays are offered to C and C++ programmers. Further study and the development of a C and C++ software test suite are recommended.
Key words: array processing, C, C++, compiler, computational speed, land-change modeling, raster-graphic image, two-dimensional array, software efficiency
Citation Information
Publication Year | 2017 |
---|---|
Title | Efficient processing of two-dimensional arrays with C or C++ |
DOI | 10.3133/tm7E1 |
Authors | David I. Donato |
Publication Type | Report |
Publication Subtype | USGS Numbered Series |
Series Title | Techniques and Methods |
Series Number | 7-E1 |
Index ID | tm7E1 |
Record Source | USGS Publications Warehouse |
USGS Organization | Eastern Geographic Science Center |
Related Content
Runtimes for Tests of Array-Processing Speed -- Factorial Tests Using C and C++ Under Windows and Linux
Related Content
- Data
Runtimes for Tests of Array-Processing Speed -- Factorial Tests Using C and C++ Under Windows and Linux
The dataset is provided as a .zip archive containing two .csv data files. These two data files contain the results of a series of timing runs made with a suite of 28 C test programs and 20 C++ test programs using three different computers and two operating systems (Windows and Linux). All 48 test programs carry out processing of two-dimensional arrays. One of the files, "C_CppTimeTestsAllRecords.c - Connect