Expand description
The optimized module contains zero-cost abstraction performance optimizations.
§Performance Optimizations Module
This module provides optimized alternatives to core LangWeave functions:
- Const static arrays instead of heap-allocated vectors
- O(1) membership testing via compile-time pattern matching
- Borrowed strings to eliminate clones
- True zero-allocation variants for hot paths
Note: This module is experimental. API may change in future versions.
Constants§
- SUPPORTED_
LANGUAGE_ CODES - Compile-time constant array of supported language codes.
Functions§
- is_
language_ supported_ optimized - Optimized version of is_language_supported() with zero heap allocations.
- is_
language_ supported_ zero_ alloc - True zero-allocation language support check.
- supported_
languages_ optimized - Optimized version of supported_languages() that returns borrowed string slices instead of heap-allocated Strings.
- translate_
optimized - Translation function with optimized language validation.