From 60a1c2ec2014b53cb61fecd8e39768da036dc34d Mon Sep 17 00:00:00 2001 From: Jack Robison Date: Sat, 2 Apr 2022 13:17:08 -0400 Subject: [PATCH] reduce cache sizes --- scribe/db/interface.py | 2 +- scribe/db/prefixes.py | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/scribe/db/interface.py b/scribe/db/interface.py index e9b5b19..4845f87 100644 --- a/scribe/db/interface.py +++ b/scribe/db/interface.py @@ -26,7 +26,7 @@ class PrefixRow(metaclass=PrefixRowType): key_struct: struct.Struct value_struct: struct.Struct key_part_lambdas = [] - cache_size: int = 1024 * 1024 * 64 + cache_size: int = 1024 * 1024 * 16 def __init__(self, db: 'rocksdb.DB', op_stack: RevertableOpStack): self._db = db diff --git a/scribe/db/prefixes.py b/scribe/db/prefixes.py index 199aad5..21c8f89 100644 --- a/scribe/db/prefixes.py +++ b/scribe/db/prefixes.py @@ -440,7 +440,7 @@ class ActiveAmountPrefixRow(PrefixRow): struct.Struct(b'>20sBLL').pack, struct.Struct(b'>20sBLLH').pack ] - cache_size = 1024 * 1024 * 128 + cache_size = 1024 * 1024 * 64 @classmethod def pack_key(cls, claim_hash: bytes, txo_type: int, activation_height: int, tx_num: int, position: int): @@ -471,7 +471,7 @@ class ClaimToTXOPrefixRow(PrefixRow): lambda: b'', struct.Struct(b'>20s').pack ] - cache_size = 1024 * 1024 * 128 + cache_size = 1024 * 1024 * 64 @classmethod def pack_key(cls, claim_hash: bytes): @@ -511,7 +511,7 @@ class TXOToClaimPrefixRow(PrefixRow): prefix = DB_PREFIXES.txo_to_claim.value key_struct = struct.Struct(b'>LH') value_struct = struct.Struct(b'>20s') - cache_size = 1024 * 1024 * 128 + cache_size = 1024 * 1024 * 64 @classmethod def pack_key(cls, tx_num: int, position: int): @@ -906,7 +906,7 @@ class EffectiveAmountPrefixRow(PrefixRow): shortid_key_helper(b'>QL'), shortid_key_helper(b'>QLH'), ] - cache_size = 1024 * 1024 * 128 + cache_size = 1024 * 1024 * 64 @classmethod def pack_key(cls, name: str, effective_amount: int, tx_num: int, position: int):