1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
//! Advanced memory optimizations for prax-query.
//!
//! This module provides high-performance memory management utilities:
//!
//! - **Enhanced string interning**: Global and scoped interning with auto-intern for identifiers
//! - **Typed arena allocators**: Efficient arena allocation for query builder chains
//! - **Lazy schema parsing**: On-demand parsing of introspection results
//!
//! # Performance Gains
//!
//! | Optimization | Feature | Memory Reduction |
//! |--------------|---------|------------------|
//! | String interning | All query builders | 20-30% |
//! | Arena allocation | High-throughput queries | 15-25% |
//! | Lazy parsing | Introspection | 40-50% |
//!
//! # Example
//!
//! ```rust,ignore
//! use prax_query::mem_optimize::{
//! interning::{GlobalInterner, ScopedInterner},
//! arena::{QueryArena, ArenaAllocated},
//! lazy::{LazySchema, LazyColumn},
//! };
//!
//! // Global string interning for identifiers
//! let field = GlobalInterner::get().intern("user_id");
//!
//! // Scoped arena for query building
//! let arena = QueryArena::new();
//! arena.scope(|scope| {
//! let filter = scope.alloc_filter(/* ... */);
//! let query = scope.build_query(filter);
//! query.to_sql() // Returns owned SQL, arena freed on scope exit
//! });
//!
//! // Lazy schema parsing
//! let schema = LazySchema::from_raw(raw_data);
//! // Columns only parsed when accessed
//! let name = schema.get_table("users")?.get_column("name")?.db_type();
//! ```
pub use ;
pub use ;
pub use ;