Ticket #10 (closed task: fixed)
[Benchmark] Reading LAS data with C++ streams
| Reported by: | mloskot | Owned by: | mloskot |
|---|---|---|---|
| Priority: | major | Milestone: | |
| Component: | Tests | Version: | |
| Keywords: | c++ benchmark | Cc: | |
| LAS Format Version: |
Description
This is simple program that presents timing of reading LAS files using C++ streams. The test directly uses basic_filebuf (read, write) instead of use stream formatting interface that is dedicated to textual content. Also, streams buffering feature is tested here.
I run tests on Windows XP (512 MB RAM, Intel Xeon 2.66 GHz) installed under Parallels VM on Mac OS X 10.4 (Mac Pro, 5 GB RAM, Intel Xeon 2x2.66 GHz). Time is calculated as arithmetic mean of 3 runs. The clearmem utility from Windows Server 2003 Resource Kit Tools is called between each run to flush disk caches and to avoid disk cache effect.
Number of milliseconds below represent time required to read all point data and calculate min/max of x, y, z values. Reading public header block is insignificant becuase in all cases it estimates between 1.5 - 2.0 millisecond.
1. LAS file 52 MB
- Option 1 (compiled with OPTION_FIRST defined)
- No buffering - 23027 ms
- Buffering ------ 493 ms
- Option 2 (undefined OPTION_FIRST)
- No buffering - 23545 ms
- Buffering ---- 10986 ms
2. LAS file 90 MB
- Option 1
- No buffering - 27960 ms
- Buffering ------ 669 ms
- Option 2
- No buffering - 28763 ms
- Buffering -----13593 ms
No buffering is tested in terms of call
std::ifstream fs; fs.rdbuf()->pubsetbuf(0, 0);
Buffering is tested using default buffer cashe size that is implementation specific. The Option 1 (#define OPTION_FIRST 1) means that a single point data is read with one call of std::ifstream::read function. The Option 2 uses 4 separate calls + 1 call to std::ifstream::seekg.
Compilation with Visual C++ 2005, using optimization /O2.
The lasperf.zip includes complete program and VC++ project + Makefile to build the test program on Unix.
