INNER CODE UNIT · Python

_MAX_BUFFER_BYTES

BlessedRebuS/Krawl · src/database/core.py:71

_MAX_BUFFER_BYTES = 64 * 1024 * 1024

_write_buffer: collections.deque = collections.deque(maxlen=_MAX_BUFFER_ROWS)
_write_lock = threading.Lock()
_dropped_rows = 0
_buffer_bytes = 0


def _entry_bytes(entry: dict) -> int:
    """Approximate heap cost of a buffered entry.

    Only the string payloads are worth counting — they are the part that
    varies by three orders of magnitude. The rest is a fixed dict overhead,
    approximated by the constant.
    """
    raw = entry.get("raw_request") or ""
    return (
        len(raw)

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…