perf: Add MEMORY_TRADEOFFS and PERFORMANCE documentation

- Introduced MEMORY_TRADEOFFS.md to explain memory vs deduplication trade-offs in anagram generation.
- Added PERFORMANCE.md detailing optimizations for handling large volumes of anagram generation efficiently.
- Created USAGE.md for comprehensive usage instructions, including installation, basic commands, and advanced generation modes.
- Enhanced generator with streaming and batch processing capabilities for improved memory management.
- Implemented quick hashing for deduplication to reduce memory footprint.
- Updated main.rs to support new command-line arguments for streaming and batch modes.
- Added tests to ensure letter removal maintains minimum word length and to verify anagram sorting functionality.
This commit is contained in:
2025-11-06 23:38:05 +01:00
parent ebdbe60e04
commit 02cf48088a
12 changed files with 1733 additions and 19 deletions

View File

@@ -125,7 +125,7 @@ fn test_letter_removal_maintains_min_word_length() {
// Should maintain at least 2 characters (word length - 1)
for anagram in &anagrams {
assert!(
anagram.text().len() >= 1,
!anagram.text().is_empty(),
"Anagram '{}' is too short",
anagram.text()
);

View File

@@ -72,7 +72,7 @@ fn test_anagram_equality() {
#[test]
fn test_anagram_sorting() {
let mut anagrams = vec![
let mut anagrams = [
Anagram::new("a".to_string(), PronouncabilityScore::new(50)),
Anagram::new("b".to_string(), PronouncabilityScore::new(80)),
Anagram::new("c".to_string(), PronouncabilityScore::new(65)),