You are viewing a plain text version of this content. The canonical link for it is here.
Posted to jira@arrow.apache.org by "Nicola Crane (Jira)" <ji...@apache.org> on 2022/09/06 14:52:00 UTC

[jira] [Comment Edited] (ARROW-17597) [R][C++] Why is read_csv_arrow so much slower when using S3 path notation?

    [ https://issues.apache.org/jira/browse/ARROW-17597?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17600811#comment-17600811 ] 

Nicola Crane edited comment on ARROW-17597 at 9/6/22 2:51 PM:
--------------------------------------------------------------

Hmm, that's a point; is accessing data via the S3 URI going to be inherently slower than accessing it via https? I tried googling this but didn't find the answer.

In terms of handling the https URL, there's a function in the R code that creates a FileSystem object by calling fs___FileSystemFromUri, and then (as it's compressed) makes it into a CompressedInputStream object.

One difference I can see is that in the first example, the stream object is a RandomAccessFile object, and in the second example it's an InputStream, so I guess those examples are using [completely different interfaces|https://arrow.apache.org/docs/cpp/io.html] for reading the data?



was (Author: thisisnic):
Hmm, that's a point; is accessing data via the S3 URI going to be inherently slower than accessing it via https? I tried googling this but didn't find the answer.

In terms of handling the https URL, there's a function in the R code that creates a FileSystem object by calling fs___FileSystemFromUri, and then (as it's compressed) makes it into a CompressedInputStream object.

One difference I can see is that in the first example, the stream object is a RandomAccessFile object, and in the second example it's an InputStream, so I guess those examples are using completely different interfaces for reading the data?


> [R][C++] Why is read_csv_arrow so much slower when using S3 path notation?
> --------------------------------------------------------------------------
>
>                 Key: ARROW-17597
>                 URL: https://issues.apache.org/jira/browse/ARROW-17597
>             Project: Apache Arrow
>          Issue Type: Bug
>          Components: C++, R
>            Reporter: Carl Boettiger
>            Priority: Minor
>
> Consider these two mechanisms for reading from a public bucket.  I was struck to see that using S3 path notation was consistently over 20 times slower than using the https address directly.  I could imagine a small overhead for using S3, but compared to other operations this seems something weird is going on here:
> {code:java}
> library(arrow)
> targe <- s3_bucket("neon4cast-targets", endpoint_override="data.ecoforecast.org", anonymous=TRUE)
> bench::bench_time({ # 58.6 seconds
>   ex1 <- read_csv_arrow(targe$path("terrestrial_30min/terrestrial_30min-targets.csv.gz"))
> })
> bench::bench_time({ # 2.7 sec
>   ex2 <- read_csv_arrow("https://data.ecoforecast.org/neon4cast-targets/terrestrial_30min/terrestrial_30min-targets.csv.gz")
> })
>  {code}



--
This message was sent by Atlassian Jira
(v8.20.10#820010)