aboutsummaryrefslogtreecommitdiff
path: root/ext/wasm/common/whwasmutil.js
diff options
context:
space:
mode:
authorstephan <stephan@noemail.net>2022-09-19 17:09:09 +0000
committerstephan <stephan@noemail.net>2022-09-19 17:09:09 +0000
commitf815011a085e86117da3e28f8281fb13cf1bcdf9 (patch)
treea408bdfa2cb7c04f6ddd7bb1571e3bed92aa8b39 /ext/wasm/common/whwasmutil.js
parent61418d5a679f11bbf3517431777c14b30252bd75 (diff)
downloadsqlite-f815011a085e86117da3e28f8281fb13cf1bcdf9.tar.gz
sqlite-f815011a085e86117da3e28f8281fb13cf1bcdf9.zip
Cut the speedtest1 runtime of the OPFS VFS proxy by approximately 3/4ths via xRead/xWrite buffer-copying optimizations. Still slower than the WASMFS impl by approx. 1/5th.
FossilOrigin-Name: fb7f287310d74a3e236125ae9c49b859f9263c29ae85161c1bcf9dd0778d8a51
Diffstat (limited to 'ext/wasm/common/whwasmutil.js')
-rw-r--r--ext/wasm/common/whwasmutil.js8
1 files changed, 8 insertions, 0 deletions
diff --git a/ext/wasm/common/whwasmutil.js b/ext/wasm/common/whwasmutil.js
index 42f602d00..46cdf84bb 100644
--- a/ext/wasm/common/whwasmutil.js
+++ b/ext/wasm/common/whwasmutil.js
@@ -603,6 +603,10 @@ self.WhWasmUtilInstaller = function(target){
out) the pointer's value, else it will contain an essentially
random value.
+ ACHTUNG: calling this often, e.g. in a loop, can have a noticably
+ painful impact on performance. Rather than doing so, use
+ heapForSize() to fetch the heap object and read directly from it.
+
See: setMemValue()
*/
target.getMemValue = function(ptr, type='i8'){
@@ -633,6 +637,10 @@ self.WhWasmUtilInstaller = function(target){
this function behaves as if the 3rd argument were `i32`.
This function returns itself.
+
+ ACHTUNG: calling this often, e.g. in a loop, can have a noticably
+ painful impact on performance. Rather than doing so, use
+ heapForSize() to fetch the heap object and assign directly to it.
*/
target.setMemValue = function f(ptr, value, type='i8'){
if (type.endsWith('*')) type = ptrIR;