perf: Phase 4+5 optimizations — uploads 10x, downloads 2x, concurrent 2x. moka cache, 512KB buffers, remove sync_all, hash-on-write, preloaded queries, bench.sh v3, gitignore storage/. 500MB upload 12.6s->1.3s (392MB/s). RSS 69-113MB, 0 swap.

This commit is contained in:
Dionisio
2026-02-15 17:53:25 +01:00
parent fac0b5e77b
commit 1ed20f425f
57 changed files with 1700 additions and 1184 deletions
@@ -491,24 +491,24 @@ impl ContactUseCase for ContactStorageAdapter {
for line in vcard_data.lines() {
let trimmed = line.trim();
if trimmed.starts_with("UID:") {
uid = Some(trimmed[4..].trim().to_string());
} else if trimmed.starts_with("FN:") {
full_name = Some(trimmed[3..].trim().to_string());
} else if trimmed.starts_with("N:") {
let parts: Vec<&str> = trimmed[2..].split(';').collect();
if let Some(stripped) = trimmed.strip_prefix("UID:") {
uid = Some(stripped.trim().to_string());
} else if let Some(stripped) = trimmed.strip_prefix("FN:") {
full_name = Some(stripped.trim().to_string());
} else if let Some(stripped) = trimmed.strip_prefix("N:") {
let parts: Vec<&str> = stripped.split(';').collect();
if parts.len() >= 2 {
last_name = Some(parts[0].trim().to_string()).filter(|s| !s.is_empty());
first_name = Some(parts[1].trim().to_string()).filter(|s| !s.is_empty());
}
} else if trimmed.starts_with("NICKNAME:") {
nickname = Some(trimmed[9..].trim().to_string());
} else if trimmed.starts_with("ORG:") {
organization = Some(trimmed[4..].trim().to_string());
} else if trimmed.starts_with("TITLE:") {
title = Some(trimmed[6..].trim().to_string());
} else if trimmed.starts_with("NOTE:") {
notes = Some(trimmed[5..].trim().to_string());
} else if let Some(stripped) = trimmed.strip_prefix("NICKNAME:") {
nickname = Some(stripped.trim().to_string());
} else if let Some(stripped) = trimmed.strip_prefix("ORG:") {
organization = Some(stripped.trim().to_string());
} else if let Some(stripped) = trimmed.strip_prefix("TITLE:") {
title = Some(stripped.trim().to_string());
} else if let Some(stripped) = trimmed.strip_prefix("NOTE:") {
notes = Some(stripped.trim().to_string());
} else if trimmed.starts_with("EMAIL") {
if let Some(value) = trimmed.split(':').nth(1)
&& !value.is_empty()