Wasmtime: separate Pool out of Engine

オープン
#15,140 コメント 2 件 リアクション 2 件 担当者 0 名 GitHub で見る

メンテナーはふだん 1 日以内に返信

まだ誰も着手していません。

評価

難易度
5/5
見積もり時間
1週間以上
初心者へのやさしさ
12/100
issue の種類
機能追加
明瞭さ
おおむね明確
活発さ
活発
技術スタック
rust, wasm
領域
backend

調査の方向性

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.

索引モデルが issue の本文から書いたものです。

説明

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.
主要言語
Rust
スター
18.8k
フォーク
1.9k
平均マージ
1日 3時間
マージ済み PR(30日)
384

環境構築

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

bytecodealliance/wasmtime のほかの issue

bytecodealliance/wasmtime の issue をすべて見る

似ている issue

Rust の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。