r-lidar / rlas

R package to read and write las and laz files used to store LiDAR data
https://cran.r-project.org/package=rlas
GNU General Public License v3.0
34 stars 14 forks source link

Use an unordered_set in thin_with_voxel #30

Closed Jean-Romain closed 5 years ago

Jean-Romain commented 5 years ago

@tiagodc could you benchmark that on TLS data.

tiagodc commented 5 years ago

sure

tiagodc commented 5 years ago

-thin_with_voxel TLS benchmark using set

Cloud 1

Voxel spacing (m) surviving points read time (s) ~ memory usage (GB)
0.1 349,787 4 0.06
0.05 925,881 5 0.12
0.025 1,718,986 7 0.18
0.01 2,414,604 7 0.25

Cloud 2

Voxel spacing (m) surviving points read time (s) ~ memory usage (GB)
0.1 1,049,797 16 0.11
0.05 2,907,514 18 0.23
0.025 6,252,097 28 0.51
0.01 9,947,220 32 0.99

Cloud 3

Voxel spacing (m) surviving points read time (s) ~ memory usage (GB)
0.1 2,606,613 91 0.21
0.05 7,602,382 104 0.67
0.025 19,556,071 126 1.62
0.01 37,853,465 138 3.18

Cloud 4

Voxel spacing (m) surviving points read time (s) ~ memory usage (GB)
0.1 1,506,216 187 0.31
0.05 4,552,934 208 0.87
0.025 12,987,644 231 1.14
0.01 41,461,462 309 3.50
Jean-Romain commented 5 years ago

Thank you Tiago but what I was expecting was a comparison between set and unordered_set. On ALS data I benchmarked a gain of ~33%

tiagodc commented 5 years ago

oh crap... I didn't see you created a new branch for that. OK, I'll pull the unordered_set branch, recompile and perform the tests again... no problem

tiagodc commented 5 years ago

-thin_with_voxel TLS benchmark using unordered_set

Cloud 1

Voxel spacing (m) surviving points read time (s) ~ memory usage (GB)
0.1 349,787 1 0.03
0.05 925,881 1 0.12
0.025 1,718,986 2 0.14
0.01 2,414,604 2 0.23

Cloud 2

Voxel spacing (m) surviving points read time (s) ~ memory usage (GB)
0.1 1,049,797 6 0.28
0.05 2,907,514 7 0.38
0.025 6,252,097 10 0.50
0.01 9,947,220 13 0.81

Cloud 3

Voxel spacing (m) surviving points read time (s) ~ memory usage (GB)
0.1 2,606,613 32 0.22
0.05 7,602,382 37 0.64
0.025 19,556,071 50 1.68
0.01 37,853,465 65 3.31

Cloud 4

Voxel spacing (m) surviving points read time (s) ~ memory usage (GB)
0.1 1,506,216 72 0.37
0.05 4,552,934 77 0.82
0.025 12,987,644 104 0.88
0.01 41,461,462 140 3.44

Conclusions

Jean-Romain commented 5 years ago

Why do you say 10% improvement. Comparing the two tables I see a > 50% improvement.

tiagodc commented 5 years ago

The time is proportional to the CPU usage... the first time I ran the tests my PC was in power management mode and only used the CPU at 10%... the second time it was 25% as it was charging, so the speed improvement was 2.5 times due to the CPU, any extra is due the usage of unordered_set instead of set...

Jean-Romain commented 5 years ago

Slightly better in computation time. No worst in memory usage. Ok I merge.