[R][C++] Why is read_csv_arrow so much slower when using S3 path notation?
- Dominant language
- C++
- Stars
- 17.1k
- Forks
- 4.3k
- Avg merge
- 3d 13h
- Merged PRs (30d)
- 88
Description
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:
```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")
})
```
**Reporter**: [Carl Boettiger](https://issues.apache.org/jira/browse/ARROW-17597) / @cboettig
**Note**: *This issue was originally created as [ARROW-17597](https://issues.apache.org/jira/browse/ARROW-17597). Please see the [migration documentation](https://github.com/apache/arrow/issues/14542) for further details.*
Contributor guide
Research direction
Reproduce the two bench_time cases using read_csv_arrow with the s3_bucket path and the direct HTTPS URL. Start at the read_csv_arrow and s3_bucket entry points, compare their request and decompression behavior, and use the benchmark timings to confirm that the S3-path performance gap is resolved.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- aws, cpp, r
- Domain
- backend, performance
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100