Crate vex_algoswitch

Crate vex_algoswitch 

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

AlgoTiming
Timing info for a single algorithm
Config
Selection configuration
HashFamily
A family of algorithms for hashing
SearchFamily
A family of algorithms for searching
SelectResult
Selection result
SortFamily
A family of algorithms for a specific task

Enums§

DataPattern
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

Type Aliases§

AlgoFn
Type alias for algorithm functions to reduce type complexity
HashFn
Type alias for hash functions
SearchFn
Type alias for search functions