Calls across stack chunks perform badly
Ninguém assumiu esta issue ainda.
- Linguagem predominante
- Python
- Estrelas
- 77.2k
- Forks
- 35.9k
- Métricas de merge de PRs
- Métricas de PR pendentes
Descrição
The Python stack is composed of a series of chunks of memory. These chunks are large, so we cross the boundaries infrequently and assume that it will never be on the fast path.
Unfortunately, it is possible to cross the boundary repeatedly if looping deep in the stack.
We should adjust the stack when crossing the boundary, to avoid doing so repeatedly.
Possible options include:
- Move the caller to the new chunk, so repeated calls do not cross the boundary.
- Instead of using a chunked stack, double the size of the stack and copy the old stack.
Both of these assume that we can move the frame. This is only possible if there are no pointers into the frame.
If a frames calls a native function taking an array of arguments, then there will be pointers into the frame.
So if we do any moving, we need to check for these pointers.
While we cannot move the frame, we can copy it, as long as the original remains. This is a bit wasteful, but shouldn't happen too often or waste too much space.
Linked PRs
- gh-145789
- gh-145828
- gh-145829
- gh-146123
- gh-148681
- gh-149097
Guia de contribuição
Primeiros passos
- Leia a issue inteira e depois o guia de contribuição do projeto.
- Comente na issue dizendo que vai assumir — evita que duas pessoas façam o mesmo trabalho.
- Faça um fork do repositório e trabalhe em uma branch.
- Abra um pull request que referencie o número da issue.
Direção de pesquisa
Comece revisando os PRs vinculados gh-145789, gh-145828, gh-145829, gh-146123, gh-148681 e gh-149097, pois a issue não fornece arquivos nem testes. O trabalho estará concluído quando evitar travessias repetidas entre chunks da stack, preservando a correção enquanto chamadas nativas mantêm ponteiros em frames.
Escrita pelo modelo de indexação a partir do texto da issue.
Avaliação
- Stack de tecnologia
- python
- Domínio
- performance
- Tipo de issue
- Bug
- Dificuldade
- 5/5
- Tempo estimado
- Mais de uma semana
- Status de atividade
- Estagnada
- Clareza
- Razoavelmente clara
- Facilidade para iniciantes
- 25/100