Performance improvements after 2.0

Offen
#449 0 Kommentare 0 Reaktionen 0 zugewiesene Personen Auf GitHub ansehen

Maintainer antworten meist innerhalb von 1 Tag

Dieses Issue hat noch niemand übernommen.

Bewertung

Schwierigkeit
4/5
Geschätzter Aufwand
3-5 Tage
Anfängerfreundlichkeit
58/100
Issue-Typ
Feature
Klarheit
Klar beschrieben
Aktivitätsstatus
Aktiv
Tech-Stack
google-cloud, python
Bereich
api, backend

Rechercherichtung

Read GoogleDriveFile.Upload() and the filesystem retry path affected by #443. Compare the current upload flow with Drive’s resumable upload session guide, focusing on retaining the session and querying its received byte offset after a connection failure. Done means retries resume from that offset while retaining the pre-generated file ID; the issue gives a 256 MiB offline measurement for comparison.

Vom Indexierungsmodell aus dem Issue-Text verfasst.

Beschreibung

Performance work deliberately left out of the 2.0 release. Each item works correctly today; it only costs more time, traffic or requests than it needs to.

Resume an interrupted upload instead of starting it again

Since #443 the filesystem repeats an upload whose connection fails, and a pre-generated file ID makes the repeat safe (no duplicate file). The repeat starts from the first byte, though:

fs.put_file("model.bin", "root/models/model.bin")  # 256 MiB

If the connection drops after 240 MiB, the filesystem sends the whole 256 MiB again, 496 MiB in total. Up to three repeats can send the file four times.

Drive keeps a resumable upload session after a dropped connection. The client can ask the session how many bytes Drive has received (an empty PUT with Content-Range: bytes */<size>) and continue from that offset (Drive guide). That needs the upload in GoogleDriveFile.Upload() to keep its session between chunks and expose the offset, and the filesystem retry to resume that session instead of calling Upload() again. The pre-generated ID stays, for a final answer that is lost.

Measured offline: a 256 MiB upload whose connection drops at 240 MiB sends 496 MiB across two sessions.

🤖 Generated with Claude Code

Vorherrschende Sprache
Python
Sterne
671
Forks
76
Ø Merge
17 Std. 55 Min.
Gemergte PRs (30 T.)
46

Entwicklungsumgebung

Erste Schritte

  1. Lesen Sie das ganze Issue und danach den Beitragsleitfaden des Projekts.
  2. Schreiben Sie ins Issue, dass Sie es übernehmen — das erspart doppelte Arbeit.
  3. Forken Sie das Repository und arbeiten Sie in einem Branch.
  4. Öffnen Sie einen Pull Request, der die Issue-Nummer nennt.

Mehr aus iterative/PyDrive2

Alle Issues in iterative/PyDrive2

Ähnliche Issues

Weitere Issues zu Python

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.