Arc-ify stored log text to remove per-line double clones (ticket 100)
DataValue::LogLiteral and IngestedLine now carry an Arc<str> instead of an owned String, so the two clones the ingest path paid per line (once to move text into the write closure, once to store it) become cheap refcount bumps instead of full string copies. Also cuts the per-string-content cost of left_right's full-EngineSnapshot deep clone on each reconciliation sync. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01TeyhRfMYjMditek6geDRoQ
This commit is contained in:
co-authored by
Claude Sonnet 5
parent
5fee6909f2
commit
f43445b280
@@ -249,7 +249,7 @@ impl EngineSnapshot {
|
||||
timestamp,
|
||||
},
|
||||
DataValue::LogLiteral { text },
|
||||
) => Some((*sequence, *timestamp, text.as_str())),
|
||||
) => Some((*sequence, *timestamp, text.as_ref())),
|
||||
_ => None,
|
||||
})
|
||||
}
|
||||
|
||||
@@ -106,7 +106,7 @@ fn logs_sorted_by_param(
|
||||
entries.push(LogEntryDto {
|
||||
sequence,
|
||||
timestamp_ms: timestamp.as_millis(),
|
||||
text: text.clone(),
|
||||
text: text.to_string(),
|
||||
params: log_entry_params(text, compiled_params),
|
||||
});
|
||||
if entries.len() >= limit {
|
||||
|
||||
Reference in New Issue
Block a user