Expand description
AlgoSwitch - Self-Optimizing Algorithm Runtime
A runtime library that automatically selects the optimal algorithm for your data patterns.
§Quick Start
ⓘ
use algoswitch::{sort, select, Config};
let mut data = vec![3, 1, 4, 1, 5, 9, 2, 6];
let result = select(
vec![
("quicksort", sort::quicksort),
("mergesort", sort::mergesort),
("heapsort", sort::heapsort),
("insertionsort", sort::insertionsort),
],
&mut data,
Config::default(),
);
println!("Winner: {} ({}ns)", result.winner, result.time_ns);Modules§
- algo
- A module to group the select function for cleaner API
- hash
- prelude
- Prelude - commonly used types and functions
- search
- sort
Structs§
- Algo
Timing - Timing info for a single algorithm
- Config
- Selection configuration
- Hash
Family - A family of algorithms for hashing
- Search
Family - A family of algorithms for searching
- Select
Result - Selection result
- Sort
Family - A family of algorithms for a specific task
Enums§
- Data
Pattern - Data pattern types
Functions§
- cache_
stats - Get cache statistics
- cache_
winner - Cache a winner for pattern
- clear_
cache - Clear the cache
- detect_
pattern - Detect the pattern in data (optimized)
- get_
cached - Get cached winner for pattern
- pattern_
name - Get pattern as string
- select
- Select the best algorithm with smart pattern detection
- select_
hash - Select best hash algorithm
- select_
search - Select best search algorithm