numcodecs_wasm
numcodecs compression for codecs compiled to WebAssembly.
numcodecs-wasm provides the WasmCodecMeta
meta class to load a codec from a WebAssembly component into a fresh Python
class.
Classes:
-
WasmCodecMeta–Meta class to create a
Codecclass from the WebAssembly componentwasm. -
WasmCodecInstructionCounterObserver–Observer that measures the number of executed instructions it takes to encode / decode.
Functions:
-
create_codec_class–Create a fresh
Codecclass from the WebAssembly componentwasm. -
read_codec_instruction_counter–Read the instruction counter of the
codec.
WasmCodecMeta
WasmCodecMeta(clsname, bases, attrs, wasm: bytes)
create_codec_class
create_codec_class(
module: ModuleType, wasm: bytes
) -> type[Codec]
Create a fresh Codec class from the WebAssembly component wasm.
The class will be created into the provided module.
| Parameters: |
|
|---|
| Returns: |
|---|
WasmCodecInstructionCounterObserver
WasmCodecInstructionCounterObserver()
Bases: CodecObserver
Observer that measures the number of executed instructions it takes to encode / decode.
The list of measurements are exposed in the
encode_instructions
and
decode_instructions
properties.
encode_instructions
property
encode_instructions: Mapping[HashableCodec, list[float]]
Per-codec-instance measurements of the number of executed instructions it takes to encode.
decode_instructions
property
decode_instructions: Mapping[HashableCodec, list[float]]
Per-codec-instance measurements of the number of executed instructions it takes to decode.