JuliaPy / JuliaPy/PythonCall.jl
reducing allocations when checking python coroutines
- Linguagem predominante
- Julia
- Estrelas
- 1.1k
- Forks
- 86
- Merge médio
- 1d 22h
- PRs com merge (30d)
- 3
Descrição
If I do:
```julia
while !Bool(fut.done())
sleep(0.01)
end
```
where `fut` is a future created like:
```julia
aio = pyimport("asyncio")
coro = aio.sleep(1)
loop = aio.Runner().get_loop()
aio.run_coroutine_threadsafe(coro, loop)
```
It allocates linearly the more you sleep.
I tried using a global julia vector `[true]` and updating it in place when the future is done, but it doesn't reduce allocations that much, is there a better way?
Guia de contribuição
Nenhum guia de contribuição indexado para este repositório
Direção de pesquisa
No repository file or test is named. Reproduce the polling example using asyncio Future.done(), Runner().get_loop(), run_coroutine_threadsafe(), and Julia sleep(), then measure allocations. Done means finding a supported approach whose allocations do not grow linearly with repeated sleeps and documenting or testing that behavior.
Escrita pelo modelo de indexação a partir do texto da issue.
Avaliação
- Stack de tecnologia
- julia, python
- Domínio
- backend
- Tipo de issue
- Bug
- Dificuldade
- 3/5
- Tempo estimado
- 1-2 dias
- Status de atividade
- Estagnada
- Clareza
- Precisa de esclarecimento
- Facilidade para iniciantes
- 35/100