Skip to content

Stream S3 downloads and load tables in parallel - #47

Closed
shreyashankar wants to merge 1 commit into
mainfrom
claude/faster-loading
Closed

shreyashankar wants to merge 1 commit into
mainfrom
claude/faster-loading

Conversation

@shreyashankar

@shreyashankar shreyashankar commented Oct 11, 2026 •

Copy link
Copy Markdown
Member

load_benchmark was very slow on a cold cache. Downloads ran at about 0.2 MB/s, so the 240 MB of scale factor 1.0 tables alone took about 20 minutes. The cause was in the download cache. It copied each S3 file through pyarrow's random access file, which sends one HTTP range request per 64 KB read. A 42 MB table took about 200 s to download, while curl took 6 s.

  • _cached_file reads a sequential stream with an 8 MB buffer.
  • One anonymous S3FileSystem is reused instead of a new one per call.
  • load_benchmark fetches its tables in parallel.

Timing for load_benchmark(scale_factor=1.0) on this branch's corpora:

Cache Before After
Cold about 20 min for the tables alone (estimated from 0.2 MB/s) 80 s, mostly network time
Warm not measured 6.4 s

Corpus IDs, label IDs, and the way they are computed are unchanged. Ruff, the long-string check, vulture, and pytest pass.

🤖 Generated with Claude Code

https://claude.ai/code/session_01LnBPDnvaDsBDWZofvX25DU

The download cache copied each S3 file through a random access file,
which sends one HTTP range request per 64 KB read. Downloads ran at
about 0.2 MB/s, so the scale factor 1.0 tables alone took about 20
minutes. The cache now reads a sequential stream, reuses one S3
filesystem, and load_benchmark fetches tables in parallel. A cold load
at scale factor 1.0 takes 80 s and a warm one 6 s.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01LnBPDnvaDsBDWZofvX25DU
@shreyashankar

Copy link
Copy Markdown
Member Author

Moved into #46.

@shreyashankar
shreyashankar deleted the claude/faster-loading branch October 11, 2026 23:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant