Performance improvements after 2.0

Aberta
#449 0 comentários 0 reações 0 responsáveis Ver no GitHub

Mantenedores costumam responder em até 1 dia

Ninguém assumiu esta issue ainda.

Avaliação

Dificuldade
4/5
Tempo estimado
3-5 dias
Facilidade para iniciantes
58/100
Tipo de issue
Funcionalidade
Clareza
Claramente especificada
Status de atividade
Ativa
Stack de tecnologia
google-cloud, python
Domínio
api, backend

Direção de pesquisa

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.

Escrita pelo modelo de indexação a partir do texto da issue.

Descrição

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

Linguagem predominante
Python
Estrelas
671
Forks
76
Merge médio
17h 55min
PRs com merge (30d)
46

Preparar o ambiente

Primeiros passos

  1. Leia a issue inteira e depois o guia de contribuição do projeto.
  2. Comente na issue dizendo que vai assumir — evita que duas pessoas façam o mesmo trabalho.
  3. Faça um fork do repositório e trabalhe em uma branch.
  4. Abra um pull request que referencie o número da issue.

Mais de iterative/PyDrive2

Todas as issues de iterative/PyDrive2

Issues semelhantes

Mais issues de Python

Receba novas issues na sua caixa de entrada

Um resumo curto de issues do GitHub para quem está começando.