xtrace_sdk.x_vec.utils.bench ============================ .. py:module:: xtrace_sdk.x_vec.utils.bench .. autoapi-nested-parse:: Lightweight benchmark context manager. Enabled by setting the ``XTRACE_BENCHMARK`` environment variable to ``1`` or ``true``. When disabled, ``bench()`` is a zero-cost no-op. Attributes ---------- .. autoapisummary:: xtrace_sdk.x_vec.utils.bench._log xtrace_sdk.x_vec.utils.bench._ENABLED Functions --------- .. autoapisummary:: xtrace_sdk.x_vec.utils.bench.bench Module Contents --------------- .. py:data:: _log .. py:data:: _ENABLED .. py:function:: bench(label) Time a block and log the result when ``XTRACE_BENCHMARK`` is enabled. Usage:: with bench("query_encrypt"): encrypted = client.encrypt_vec_one(vec)