S3Client instantiation extremely slow
- Vorherrschende Sprache
- C++
- Sterne
- 2.2k
- Forks
- 1.2k
- Ø Merge
- 4 T. 11 Std.
- Gemergte PRs (30 T.)
- 13
Beschreibung
### Describe the bug
One of our users has [reported](https://github.com/apache/arrow/issues/40279) that creating a S3Client instance can take up to 1 millisecond. According to profiler statistics, most of the time is spent in `Aws::Crt::Endpoints::RuleEngine` (see linked issue).
### Expected Behavior
I would expect a `S3Client` to be reasonably fast to instantiate (less than a microsecond).
### Current Behavior
See description and profile graph excerpt in linked issue.
### Reproduction Steps
Using PyArrow:
```python
>>> from pyarrow.fs import S3FileSystem
>>> %timeit s = S3FileSystem()
1.29 ms ± 1.27 µs per loop (mean ± std. dev. of 7 runs, 1,000 loops each)
>>> %timeit s = S3FileSystem(anonymous=True)
1.29 ms ± 5.52 µs per loop (mean ± std. dev. of 7 runs, 1,000 loops each)
>>> %timeit s = S3FileSystem(anonymous=True, region='eu-west-1')
1.29 ms ± 4.86 µs per loop (mean ± std. dev. of 7 runs, 1,000 loops each)
```
### Possible Solution
_No response_
### Additional Information/Context
_No response_
### AWS CPP SDK version used
1.11.267
### Compiler and Version used
gcc 12.3.0
### Operating System and version
Ubuntu 22.04
Beitragsleitfaden
Rechercherichtung
Beginne damit, die Konstruktion von S3Client anhand der PyArrow S3FileSystem-Beispiele zu reproduzieren, und profiliere den in der Issue beschriebenen Pfad Aws::Crt::Endpoints::RuleEngine. Vergleiche die Konstruktion mit und ohne anonymen Zugriff sowie mit einer expliziten Region; fertig ist die Aufgabe, wenn der Overhead der Endpunktauflösung deutlich reduziert ist und das bestehende Verhalten von S3Client korrekt bleibt.
Vom Indexierungsmodell aus dem Issue-Text verfasst.
Bewertung
- Tech-Stack
- aws, cpp
- Bereich
- backend, cloud
- Issue-Typ
- Bug
- Schwierigkeit
- 4/5
- Geschätzter Aufwand
- 3-5 Tage
- Aktivitätsstatus
- Veraltet
- Klarheit
- Größtenteils klar
- Anfängerfreundlichkeit
- 35/100