Replies: 2 comments 11 replies
-
3 things:
|
Beta Was this translation helpful? Give feedback.
-
So I tested this again, with current lasR version and restarted R between each run. While I understand that we cannot expect it to be 4 or 16 times faster, I am still wondering that it is barely faster (some percent)!? Although we see here that each file/chunk is processed in a different thread this looks different to me when we have a look at the output with 4 files - 1 corelibrary(lasR)
folder <- "L:/lidar/ALS/he/tmp"
f <- list.files(folder, full.names = T)
cores <- 1
# valid CRS?
sf::st_crs(lidR::readLASheader(f[1]))
#> Coordinate Reference System: NA
# is indexed?
lasR:::is_indexed(f)
#> [1] FALSE FALSE FALSE FALSE
start.time <- Sys.time()
exec(
set_crs(25832) + write_lax(embedded = TRUE),
with = list(verbose = TRUE, ncores = concurrent_files(cores)),
on = f
)
#> File processing options:
#> Read points: false
#> Streamable: true
#> Buffer: 0.0
#> Concurrent files: 1
#> Concurrent points: 1
#> Chunks: 4
#>
#> Processing chunk 1/4 in thread 0: 3dm_32450_5537_1_he
#> Processing chunk 2/4 in thread 0: 3dm_32450_5538_1_he
#> Processing chunk 3/4 in thread 0: 3dm_32450_5539_1_he
#> Processing chunk 4/4 in thread 0: 3dm_32450_5540_1_he
#> NULL
end.time <- Sys.time()
time.taken <- end.time - start.time
time.taken
#> Time difference of 43.34974 secs
# valid CRS?
sf::st_crs(lidR::readLASheader(f[1]))
#> Coordinate Reference System: NA
# is indexed?
lasR:::is_indexed(f)
#> [1] TRUE TRUE TRUE TRUE 4 files - 4 coreslibrary(lasR)
folder <- "L:/lidar/ALS/he/tmp"
f <- list.files(folder, full.names = T)
cores <- 4
# valid CRS?
sf::st_crs(lidR::readLASheader(f[1]))
#> Coordinate Reference System: NA
# is indexed?
lasR:::is_indexed(f)
#> [1] FALSE FALSE FALSE FALSE
start.time <- Sys.time()
exec(
set_crs(25832) + write_lax(embedded = TRUE),
with = list(verbose = TRUE, ncores = concurrent_files(cores)),
on = f
)
#> File processing options:
#> Read points: false
#> Streamable: true
#> Buffer: 0.0
#> Concurrent files: 4
#> Concurrent points: 1
#> Chunks: 4
#>
#> Processing chunk 1/4 in thread 2: 3dm_32450_5537_1_he
#> Processing chunk 4/4 in thread 0: 3dm_32450_5540_1_he
#> Processing chunk 3/4 in thread 1: 3dm_32450_5539_1_he
#> Processing chunk 2/4 in thread 3: 3dm_32450_5538_1_he
#> NULL
end.time <- Sys.time()
time.taken <- end.time - start.time
time.taken
#> Time difference of 40.79333 secs
# valid CRS?
sf::st_crs(lidR::readLASheader(f[1]))
#> Coordinate Reference System: NA
# is indexed?
lasR:::is_indexed(f)
#> [1] TRUE TRUE TRUE TRUE 16 files - 1 corelibrary(lasR)
folder <- "L:/lidar/ALS/he/tmp"
f <- list.files(folder, full.names = T)
cores <- 1
# valid CRS?
sf::st_crs(lidR::readLASheader(f[1]))
#> Coordinate Reference System: NA
# is indexed?
lasR:::is_indexed(f)
#> [1] FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE
#> [13] FALSE FALSE FALSE FALSE
start.time <- Sys.time()
exec(
set_crs(25832) + write_lax(embedded = TRUE),
with = list(verbose = TRUE, ncores = concurrent_files(cores)),
on = f
)
#> File processing options:
#> Read points: false
#> Streamable: true
#> Buffer: 0.0
#> Concurrent files: 1
#> Concurrent points: 1
#> Chunks: 16
#>
#> Processing chunk 1/16 in thread 0: 3dm_32450_5537_1_he
#> Processing chunk 2/16 in thread 0: 3dm_32450_5538_1_he
#> Processing chunk 3/16 in thread 0: 3dm_32450_5539_1_he
#> Processing chunk 4/16 in thread 0: 3dm_32450_5540_1_he
#> Processing chunk 5/16 in thread 0: 3dm_32450_5541_1_he
#> Processing chunk 6/16 in thread 0: 3dm_32450_5542_1_he
#> Processing chunk 7/16 in thread 0: 3dm_32450_5543_1_he
#> Processing chunk 8/16 in thread 0: 3dm_32450_5544_1_he
#> Processing chunk 9/16 in thread 0: 3dm_32450_5545_1_he
#> Processing chunk 10/16 in thread 0: 3dm_32450_5546_1_he
#> Processing chunk 11/16 in thread 0: 3dm_32450_5547_1_he
#> Processing chunk 12/16 in thread 0: 3dm_32450_5548_1_he
#> Processing chunk 13/16 in thread 0: 3dm_32450_5549_1_he
#> Processing chunk 14/16 in thread 0: 3dm_32450_5550_1_he
#> Processing chunk 15/16 in thread 0: 3dm_32450_5551_1_he
#> Processing chunk 16/16 in thread 0: 3dm_32450_5552_1_he
#> NULL
end.time <- Sys.time()
time.taken <- end.time - start.time
time.taken
#> Time difference of 3.678571 mins
# valid CRS?
sf::st_crs(lidR::readLASheader(f[1]))
#> Coordinate Reference System: NA
# is indexed?
lasR:::is_indexed(f)
#> [1] TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE
#> [16] TRUE 16 files - 16 coreslibrary(lasR)
folder <- "L:/lidar/ALS/he/tmp"
f <- list.files(folder, full.names = T)
cores <- 16
# valid CRS?
sf::st_crs(lidR::readLASheader(f[1]))
#> Coordinate Reference System: NA
# is indexed?
lasR:::is_indexed(f)
#> [1] FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE
#> [13] FALSE FALSE FALSE FALSE
start.time <- Sys.time()
exec(
set_crs(25832) + write_lax(embedded = TRUE),
with = list(verbose = TRUE, ncores = concurrent_files(cores)),
on = f
)
#> File processing options:
#> Read points: false
#> Streamable: true
#> Buffer: 0.0
#> Concurrent files: 16
#> Concurrent points: 1
#> Chunks: 16
#>
#> Processing chunk 1/16 in thread 0: 3dm_32450_5537_1_he
#> Processing chunk 4/16 in thread 11: 3dm_32450_5540_1_he
#> Processing chunk 5/16 in thread 1: 3dm_32450_5541_1_he
#> Processing chunk 2/16 in thread 4: 3dm_32450_5538_1_he
#> Processing chunk 3/16 in thread 15: 3dm_32450_5539_1_he
#> Processing chunk 6/16 in thread 3: 3dm_32450_5542_1_he
#> Processing chunk 7/16 in thread 7: 3dm_32450_5543_1_he
#> Processing chunk 9/16 in thread 5: 3dm_32450_5545_1_he
#> Processing chunk 12/16 in thread 9: 3dm_32450_5548_1_he
#> Processing chunk 15/16 in thread 2: 3dm_32450_5551_1_he
#> Processing chunk 16/16 in thread 6: 3dm_32450_5552_1_he
#> Processing chunk 13/16 in thread 13: 3dm_32450_5549_1_he
#> Processing chunk 8/16 in thread 10: 3dm_32450_5544_1_he
#> Processing chunk 11/16 in thread 12: 3dm_32450_5547_1_he
#> Processing chunk 14/16 in thread 8: 3dm_32450_5550_1_he
#> Processing chunk 10/16 in thread 14: 3dm_32450_5546_1_he
#> NULL
end.time <- Sys.time()
time.taken <- end.time - start.time
time.taken
#> Time difference of 3.592971 mins
# valid CRS?
sf::st_crs(lidR::readLASheader(f[1]))
#> Coordinate Reference System: NA
# is indexed?
lasR:::is_indexed(f)
#> [1] TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE
#> [16] TRUE Other questions:
|
Beta Was this translation helpful? Give feedback.
-
When I wanted to spatially index files I was wondering that it took quite long although I intended to use multiple cores in parallel.
So when I ran it on multiple files (4 in the example below) concurrently processing time is almost 3-4x than when I run it on a single file, I expected it to be more or less similarly fast.
I am unsure if this is an issue, more likely I understood or wrote something wrong.
Running the pipeline on a folder with 1 file and 1 core
Running the pipeline on a folder with 4 files and 4 cores.
Beta Was this translation helpful? Give feedback.
All reactions