Wasmtime: separate Pool out of Engine

Abierto
#15,140 2 comentarios 2 reacciones 0 asignados Ver en GitHub

Los mantenedores suelen responder en 1 día

Nadie ha tomado este issue todavía.

Evaluación

Dificultad
5/5
Tiempo estimado
Más de una semana
Aptitud para principiantes
12/100
Tipo de issue
Nueva funcionalidad
Claridad
Bastante claro
Estado de actividad
Activo
Stack tecnológico
rust, wasm
Área
backend

Línea de trabajo

This is a design proposal, not a ready change: the payload names only PoolingAllocatorConfig, Engine, Component::new, Component::required_resources and Store::new. Start by reading how PoolingAllocatorConfig ties allocation settings to Engine construction, and decide which settings affect codegen and must stay on Engine. Done means an agreed design for a separate Pool type, not a patch. Ask the maintainers before writing code.

Escrito por el modelo de indexación a partir del texto del issue.

Descripción

For historical reasons, Wasmtime's pooling allocator and the Engine struct are joined at the hip. Some aspects that affect pooling are indeed linked to codegen and therefore an Engine, but other aspects are not necessarily linked and, in fact this makes some kinds of configurations - the reasonable problem statement "I want a pooling allocator which can provide N instances of Component X" - unnecessarily difficult, or require crude hacks (e.g. serializing and deserializing a Component to move it between code-compatible Engines).

My rough design sketch:

  • Engine construction still locks in all aspects of a Module and Component's compilation that affect codegen. This is a very important design principle of Wasmtime we should consider basically set in stone.
  • There can be more than one allocator of Stores/Instances associated with an Engine, and the lifetime of those can be shorter than the Engine.
  • An Engine can be used for Component::new, and then a pooling allocator (as a new struct wasmtime::Pool) can be constructed based on Component::required_resources and the number of slots desired - basically, we separate out all aspects of PoolingAllocatorConfig that do not affect codegen, and make that construct a Pool, not an Engine. Notionally, Pool::new_store(&self, data) -> Result<Store<T>> works like Store::new(&Engine, data) -> Store<T>, failing when the pool does not have available slots.
  • In the absence of Pool use, all of the existing Engine machinery works with the on-demand allocator.
Lenguaje dominante
Rust
Estrellas
18.8k
Forks
1.9k
Merge medio
1 d 3 h
PR fusionados (30 d)
380

Preparar el entorno

Primeros pasos

  1. Lee el issue completo y luego la guía de contribución del proyecto.
  2. Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
  3. Haz un fork del repositorio y trabaja en una rama.
  4. Abre un pull request que haga referencia al número del issue.

Más de bytecodealliance/wasmtime

Todos los issues de bytecodealliance/wasmtime

Issues similares

Más issues de Rust

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.