Skip to content

LocalStorage Speed

W. "Mac" McMeans edited this page Aug 11, 2022 · 6 revisions

The data from localStorage is stored in an SQLite database on the user's filesystem. Read operations are generally considered very quick.

Some benchmarks compare the speed of disk-based IO to the efficiency of reading and writing to memory. Even with SSD hardware, how will any filesystem be comparable to direct memory? In automotive terms, it's like comparing the performance of a Chevy Chevette to a Lamborghini, and then railing at the Chevette for being slower.

How could it be otherwise?

If the raw speed of localStorage by itself is unsatisfactory, you'll get no further joy using locaDataStorage. The convenience factor of data type tracking, string compression, etc. comes at a cost, and read/write times will be minimally slower compared to using the native API without a wrapper.

For ultimate speed, localDataStorage lets you use Memory Keys. However, change events are not triggered.

localStorage Keys

The usual suspects:

set / get      clear      key      remove

The esoteric ones:

Array Keys:
push / pull, pullall      poke      contains      where

Broadcasting:
broadcast

Bypass:
forceset / forceget

Data Transfer:
import / export

Duplicates:
countdupes, showdupes, listdupes

Internals:
cancrunch      crunch / uncrunch

shufflestring / unshufflestring

xorstring

Management:
keys

Memory Consumption:

Memory Quota:
showquota

Query:
haskey, hasval, hastype

Security:
safeset / safeget

setscramblekey / getscramblekey

Type Check:
isarray      isbigint      isboolean      iscrunch

isdate      isfloat      isinteger      isnull

isnumber      isobject      isstring

showtype

Utility:
chopget      copy      softset      rename

Properties:

channel      length      quota      version

Settings:

verbosity

Memory Keys

Standard:

_set / _get      _clear      _key      _remove

Unconventional:

Data Sync:
_backup / _restore

Management:
_keys

Security:
_safeset / _safeget

Type Check:
_isarray      _isbigint      _isboolean      _iscrunch

_isdate      _isfloat      _isinteger      _isnull

_isnumber      _isobject      _isstring

_showtype

Utility:
_chopget      _copy      _softset      _rename

Clone this wiki locally