Ticket #10 (closed task: fixed)

Opened 18 months ago

Last modified 16 months ago

[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.

Attachments

lasperf.zip (5.7 kB) - added by mloskot 18 months ago.
The libperf.cpp program with Visual C++ 2005 solution and Makefile for make

Change History

Changed 18 months ago by mloskot

The libperf.cpp program with Visual C++ 2005 solution and Makefile for make

Changed 18 months ago by mloskot

The 90 MB file I used in during the tests above is Serpent_Mound_LAS_Data.las linked at Martin's website. The 52MB file is LDR030828_213450_0.LAS from the LeicaSampleLAS2.zip package also linked on Martin's website.

Changed 18 months ago by hobu

My results are comparable with a 104MB LAS file from the Iowa DNR.

http://www.geotree.uni.edu/IowaLidar/04604536.las.7z

Option 1: --- Read 3895168 point records (510.599000 ms) --- Option 2: --- Read 3895168 point records (24545.234000 ms) ---

An interesting bit is this file doesn't report any points by return:

File: 04664550.las (Option 2)
--- LAS File Header (0.022 ms) ---

file_signature      : LASF
file_source_id      : 0
reserved            : 0
guid_1              : 0
guid_2              : 0
guid_3              : 0
guid_4              : 
version_major       : 1
version_minor       : 0
system_identifier   : 
generating_software : TerraScan
file_creation_day   : 0
file_creation_year  : 0
header_size         : 227
offset_to_point_data: 229
number_of_records   : 0
point_data_format   : 1
point_record_length : 28
number_of_point_records   : 3895168
number_of_points_by_return: 0, 0, 0, 0, 0, 
 scale              : 0.010000, 0.010000, 0.010000
 offset             : -0.000000, -0.000000, -0.000000
 min                : 466000.000000, 4550000.000000, 254.000000
 max                : 467999.920000, 4551999.920000, 333.000000


--- Read 3895168 point records (24545.234000 ms) ---

X: -2147472740.000000   2147475585.000000
Y: -2147481322.000000   2147466371.000000
Y: -2147482814.000000   2147477387.000000

Changed 16 months ago by mloskot

  • owner changed from hobu to mloskot

Changed 16 months ago by mloskot

  • status changed from new to closed
  • resolution set to fixed

I think we have completed benchmarking pretty well.

Note: See TracTickets for help on using tickets.