From: stephan Date: Fri, 27 Feb 2026 03:21:47 +0000 (+0000) Subject: JS: slight performance improvements in KVVfsStorage. X-Git-Tag: version-3.52.0~28 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=d22d0edc482bd0b6ed063cd5adab8a8cb3cd917e;p=thirdparty%2Fsqlite.git JS: slight performance improvements in KVVfsStorage. FossilOrigin-Name: 56edf2addb155dbb60269fe563ecb5f6132672c6c61f6f9d18ebdff72111298d --- diff --git a/ext/wasm/api/sqlite3-vfs-kvvfs.c-pp.js b/ext/wasm/api/sqlite3-vfs-kvvfs.c-pp.js index a78c0548b7..f04ae379a0 100644 --- a/ext/wasm/api/sqlite3-vfs-kvvfs.c-pp.js +++ b/ext/wasm/api/sqlite3-vfs-kvvfs.c-pp.js @@ -209,17 +209,21 @@ globalThis.sqlite3ApiBootstrap.initializers.push(function(sqlite3){ and recreating it whenever a property index might be invalidated. */ class KVVfsStorage { - #map; - #keys; - #getKeys(){return this.#keys ??= Object.keys(this.#map);} + #map = Object.create(null); + #keys = null; + #size = 0; constructor(){ this.clear(); } + #getKeys(){ + return this.#keys ??= Object.keys(this.#map); + } + key(n){ const k = this.#getKeys(); - return n=0 && n