Skip to main content

Module optimized

Module optimized 

Source
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.