Skip to content

Commit

Permalink
move some more doc
Browse files Browse the repository at this point in the history
  • Loading branch information
yamt committed Jun 24, 2023
1 parent 6a48fed commit cd8d6da
Show file tree
Hide file tree
Showing 2 changed files with 37 additions and 37 deletions.
37 changes: 0 additions & 37 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -135,43 +135,6 @@ See example apps:
[labels as values](https://gcc.gnu.org/onlinedocs/gcc/Labels-as-Values.html),
which are well-known techniques to implement efficient interpreters.

### Overhead of the annotations

The memory consumption for the above mentioned annotations
depends on the wasm bytecode to annotate.
The following is a few examples taken with wasm modules I happened
to have.

#### toywasm

```
wasm instructions to annotate 368444 bytes
jump table overhead 80192 bytes
type annotation overhead 16568 bytes
local type cell idx overhead 16480 bytes
result type cell idx overhead 1006 bytes
```

#### spidermonkey

```
wasm instructions to annotate 4143921 bytes
jump table overhead 1166528 bytes
type annotation overhead 142304 bytes
local type cell idx overhead 109880 bytes
result type cell idx overhead 2448 bytes
```

#### ffmpeg

```
wasm instructions to annotate 15442793 bytes
jump table overhead 2715248 bytes
type annotation overhead 335344 bytes
local type cell idx overhead 388730 bytes
result type cell idx overhead 5882 bytes
```

## Internals

* [Annotations](./doc/annotations.md)
Expand Down
37 changes: 37 additions & 0 deletions doc/annotations.md
Original file line number Diff line number Diff line change
Expand Up @@ -56,3 +56,40 @@ expensive.
This annotation is unconditionally enabled if and only if toywasm is
built with variable-sized values, which is the default.
(`-D TOYWASM_USE_SMALL_CELLS=ON`)

## Overhead of the annotations

The memory consumption for the above mentioned annotations
depends on the wasm bytecode to annotate.
The following is a few examples taken with wasm modules I happened
to have.

### toywasm

```
wasm instructions to annotate 368444 bytes
jump table overhead 80192 bytes
type annotation overhead 16568 bytes
local type cell idx overhead 16480 bytes
result type cell idx overhead 1006 bytes
```

### spidermonkey

```
wasm instructions to annotate 4143921 bytes
jump table overhead 1166528 bytes
type annotation overhead 142304 bytes
local type cell idx overhead 109880 bytes
result type cell idx overhead 2448 bytes
```

### ffmpeg

```
wasm instructions to annotate 15442793 bytes
jump table overhead 2715248 bytes
type annotation overhead 335344 bytes
local type cell idx overhead 388730 bytes
result type cell idx overhead 5882 bytes
```

0 comments on commit cd8d6da

Please sign in to comment.