-
-
Notifications
You must be signed in to change notification settings - Fork 15
Memory Requirements
There is a difference between the memory required to store a key value and the memory consumed in the process. For JavaScript, consumption is doubled that of storage.
The following table illustrates memory storage and consumption, for both a key name and its value, as well as the available methods for determining each:
Prefix | Example | Key Name |
Key Memory Storage keybytes |
Key Memory Consumption⑴ keybytesall |
Data Type |
Data Value |
Internally Stored As |
Value Memory Storage valbytes |
Value Memory Consumption⑵ valbytesall |
---|---|---|---|---|---|---|---|---|---|
lds-1. | .set( 'skey1', '["x"]' ) | skey1 | 5 bytes | 11 bytes | Array | [x] | ["x"]� | 5 bytes | 6 bytes |
☝ | .set( 'skey1', 12n ) | ☝ | ☝ | ☝ | BigInt | 12n | 12� | 2 bytes | 3 bytes |
☝ | .set( 'skey1', true ) | ☝ | ☝ | ☝ | Boolean | true | 1� | 1 byte | 2 bytes |
☝ | .set( 'skey1', false ) | ☝ | ☝ | ☝ | Boolean | false | 0� | 1 byte | 2 bytes |
☝ | .set( 'skey1', new Date() ) | ☝ | ☝ | ☝ | Date | ~ | ZVRnbZS� | 7 bytes | 8 bytes |
☝ | .set( 'skey1', 19.99 ) | ☝ | ☝ | ☝ | Float | 19.99 | 19.99� | 5 bytes | 6 bytes |
☝ | .set( 'skey1', 1234 ) | ☝ | ☝ | ☝ | Integer | 1234 | 1234� | 4 bytes | 5 bytes |
☝ | .set( 'skey1', null ) | ☝ | ☝ | ☝ | null | null | null� | 4 bytes | 5 bytes |
☝ | .set( 'skey1', {'a':1} ) | ☝ | ☝ | ☝ | Object | {'a':1} | {'a':1}� | 7 bytes | 8 bytes |
☝ | .set( 'skey1', 'lds' ) | ☝ | ☝ | ☝ | String | 'lds' | lds� | 3 bytes | 4 bytes |
⑴ includes the namespace prefix (6 bytes, in this example)
⑵ includes the data type marker flag (always 1 byte)
Array Keys:
push / pull, pullall poke contains where
Broadcasting:
broadcast
Data Transfer:
import / export
Duplicates:
countdupes, showdupes, listdupes
Internals:
cancrunch crunch / uncrunch
shufflestring / unshufflestring
Management:
keys
Memory Consumption:
Memory Quota:
showquota
Query:
haskey, hasval, hastype
setscramblekey / getscramblekey
Type Check:
isarray isbigint isboolean iscrunch
isdate isfloat isinteger isnull
Utility:
chopget copy softset rename
_set / _get _clear _key _remove
Management:
_keys
Type Check:
_isarray _isbigint _isboolean _iscrunch