Skip to content

perf: reduce exporter memory footprint with disk staging and streaming generation - #5919

Open
another-rex wants to merge 13 commits into
google:masterfrom
another-rex:optimize_exporter_memory
Open

perf: reduce exporter memory footprint with disk staging and streaming generation#5919
another-rex wants to merge 13 commits into
google:masterfrom
another-rex:optimize_exporter_memory

Conversation

@another-rex

@another-rex another-rex commented Aug 26, 2026

Copy link
Copy Markdown
Contributor

Rather than keeping everything in memory, then writing it out at the end in order. Save the records into a temporary location on disk in JSON, then io.copy them into a zip in order. Streaming the output to GCS.

@another-rex
another-rex marked this pull request as draft August 26, 2026 04:20

@michaelkedar michaelkedar left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Seems okay.
I wonder how much slower this will be with the disk reading/writing?
Hopefully it doesn't push the exporter above 15 minutes...

Comment thread go/cmd/exporter/downloader.go
Comment thread go/cmd/exporter/worker.go Outdated

// csvEntry holds the unix timestamp in nanoseconds and the relative entry path.
type csvEntry struct {
modified int64

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

changing this to a time.Time (or the RFC string) will probably make logic around this neater

Comment thread go/cmd/exporter/writer.go Outdated
@another-rex
another-rex marked this pull request as ready for review August 27, 2026 00:34
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.

2 participants