This pull request introduces benchmarks for six coin selection algorithms in the rust-coinselect library using the criterion crate. These benchmarks will help assess and optimize performance across different strategies.
Algorithms to be Benchmarked
BNB (Branch and Bound): Efficiently solves combinatorial optimization problems by exploring possible solutions and pruning suboptimal branches.
FIFO (First In, First Out): Selects coins based on their order of arrival, providing a straightforward selection method.
Knapsack: Aims to maximize the value of selected coins while adhering to a weight limit, mimicking the classic knapsack problem.
Lowest Larger: Chooses the smallest available coin larger than the target amount; defaults to another strategy if none exist.
SRD (Single Random Draw): Randomly selects a coin from available inputs, useful for testing distribution.
select_coin Function: A high-level interface that wraps the above algorithms, allowing for unified performance evaluation.
Importance of Benchmarking
Benchmarking is vital for:
Performance Optimization: Identifying and addressing bottlenecks.
Algorithm Comparison: Evaluating efficiency under various conditions.
Regression Detection: Monitoring for performance changes with new updates.
Resource Management: Efficiently utilizing CPU and memory.
Enhanced User Experience: Ensuring responsive application performance.
This addition ensures that we can effectively measure and optimize the performance of our coin selection algorithms, maintaining high efficiency for the rust-coinselect library.
Benchmarking Coin Selection Algorithms
This pull request introduces benchmarks for six coin selection algorithms in the
rust-coinselect
library using thecriterion
crate. These benchmarks will help assess and optimize performance across different strategies.Algorithms to be Benchmarked
BNB (Branch and Bound): Efficiently solves combinatorial optimization problems by exploring possible solutions and pruning suboptimal branches.
FIFO (First In, First Out): Selects coins based on their order of arrival, providing a straightforward selection method.
Knapsack: Aims to maximize the value of selected coins while adhering to a weight limit, mimicking the classic knapsack problem.
Lowest Larger: Chooses the smallest available coin larger than the target amount; defaults to another strategy if none exist.
SRD (Single Random Draw): Randomly selects a coin from available inputs, useful for testing distribution.
select_coin
Function: A high-level interface that wraps the above algorithms, allowing for unified performance evaluation.Importance of Benchmarking
Benchmarking is vital for:
This addition ensures that we can effectively measure and optimize the performance of our coin selection algorithms, maintaining high efficiency for the
rust-coinselect
library.