perf: Arc-wrap SearchResultsDto for zero-copy cache reads

- Change SearchUseCase::search() return type to Arc<SearchResultsDto>
- Replace Cache<u64, SearchResultsDto> with Cache<u64, Arc<SearchResultsDto>>
- Eliminate .clone() on full result set; use Arc::clone() (ptr bump)
- Remove Clone derive from SearchResultsDto (no longer needed)
- Update handlers to deref Arc for JSON serialization
This commit is contained in:
Dionisio
2026-02-25 23:47:51 +01:00
parent 5a1959bf23
commit 5b55056921
5 changed files with 24 additions and 21 deletions
@@ -67,7 +67,7 @@ impl SearchHandler {
results.files.len(),
results.folders.len()
);
(StatusCode::OK, Json(results)).into_response()
(StatusCode::OK, Json(&*results)).into_response()
}
Err(err) => {
error!("Search error: {}", err);
@@ -108,7 +108,7 @@ impl SearchHandler {
results.files.len(),
results.folders.len()
);
(StatusCode::OK, Json(results)).into_response()
(StatusCode::OK, Json(&*results)).into_response()
}
Err(err) => {
error!("Search error: {}", err);