Skip to content

Commit a6d299d

Browse files
committed
Some more quick README updates
1 parent 3194760 commit a6d299d

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -121,14 +121,14 @@ Please see the [AssemblyScript Docs on runtime variants](https://docs.assemblysc
121121

122122
## Performance
123123

124+
**TL;DR** This library should be fast, but depending on your project you may want some more careful consideration.
125+
124126
as-bind does all of it's data passing at runtime. Meaning this will be slower than a code generated bindings generator, such as something like [wasm-bindgen](https://github.com/rustwasm/wasm-bindgen). This is because, as-bind needs to cycle through every supported type on every paremeter or return value for each function, whenever the function is called. However, this is mitigated due to the Speculative execution that the library implements. Which. in this case it means, that the library by default will assume the type of value being passed to, or returned by a function will not change, and will only have to cycle through the params once, and then after that, it would be as fast as a code generated solution (in theory). This speculative execution can be turned off as specified in the Reference API.
125127

126128
If your project is doing one-off processing using a high level data type, this project should have a very small impact on performance of your project. However, if you project is doing it's processing in a very time constrained loop (such as a game running at 60fps), you may want to be more considerate when choosing this library. The speculative execution should greatly help in the amount of time to pass high level data types, but if your game is already not running as fast as you would like, you may want to avoid this library, or even not using high level data types, for passing memory to your WebAssembly module.
127129

128130
Eventually for the most performant option, we would want to do some JavaScript code generation in the AssemblyScript compiler itself, as part of an `as-bindgen` project for the most performant data passing.
129131

130-
**TL;DR** This library should be fast, but depending on your project you may want some more careful consideration.
131-
132132
## Reference API
133133

134134
### AsBind
@@ -153,7 +153,7 @@ AsBind.instantiate: (
153153
WebAssembly.Module |
154154
BufferSource |
155155
Response |
156-
PromiseLike<WebAssembly.Module |
156+
PromiseLike<WebAssembly.Module> |
157157
BufferSource |
158158
Response
159159
),

0 commit comments

Comments
 (0)