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:
@@ -78,22 +78,20 @@ impl CalDavAdapter {
|
||||
s if s == "filter" || s.ends_with(":filter") => in_filter = true,
|
||||
s if s == "time-range" || s.ends_with(":time-range") => {
|
||||
// Parse time-range attributes
|
||||
for attr in e.attributes() {
|
||||
if let Ok(attr) = attr {
|
||||
let attr_name =
|
||||
std::str::from_utf8(attr.key.as_ref()).unwrap_or("");
|
||||
let attr_value = attr.unescape_value().unwrap_or_default();
|
||||
for attr in e.attributes().flatten() {
|
||||
let attr_name =
|
||||
std::str::from_utf8(attr.key.as_ref()).unwrap_or("");
|
||||
let attr_value = attr.unescape_value().unwrap_or_default();
|
||||
|
||||
if attr_name == "start" {
|
||||
// Parse ISO date format with Z for UTC
|
||||
start_time = DateTime::parse_from_rfc3339(&attr_value)
|
||||
.ok()
|
||||
.map(|dt| dt.with_timezone(&Utc));
|
||||
} else if attr_name == "end" {
|
||||
end_time = DateTime::parse_from_rfc3339(&attr_value)
|
||||
.ok()
|
||||
.map(|dt| dt.with_timezone(&Utc));
|
||||
}
|
||||
if attr_name == "start" {
|
||||
// Parse ISO date format with Z for UTC
|
||||
start_time = DateTime::parse_from_rfc3339(&attr_value)
|
||||
.ok()
|
||||
.map(|dt| dt.with_timezone(&Utc));
|
||||
} else if attr_name == "end" {
|
||||
end_time = DateTime::parse_from_rfc3339(&attr_value)
|
||||
.ok()
|
||||
.map(|dt| dt.with_timezone(&Utc));
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -151,22 +149,20 @@ impl CalDavAdapter {
|
||||
props.push(QualifiedName::new(namespace, prop_name));
|
||||
} else if name_str == "time-range" || name_str.ends_with(":time-range") {
|
||||
// Parse time-range attributes
|
||||
for attr in e.attributes() {
|
||||
if let Ok(attr) = attr {
|
||||
let attr_name =
|
||||
std::str::from_utf8(attr.key.as_ref()).unwrap_or("");
|
||||
let attr_value = attr.unescape_value().unwrap_or_default();
|
||||
for attr in e.attributes().flatten() {
|
||||
let attr_name =
|
||||
std::str::from_utf8(attr.key.as_ref()).unwrap_or("");
|
||||
let attr_value = attr.unescape_value().unwrap_or_default();
|
||||
|
||||
if attr_name == "start" {
|
||||
// Parse ISO date format with Z for UTC
|
||||
start_time = DateTime::parse_from_rfc3339(&attr_value)
|
||||
.ok()
|
||||
.map(|dt| dt.with_timezone(&Utc));
|
||||
} else if attr_name == "end" {
|
||||
end_time = DateTime::parse_from_rfc3339(&attr_value)
|
||||
.ok()
|
||||
.map(|dt| dt.with_timezone(&Utc));
|
||||
}
|
||||
if attr_name == "start" {
|
||||
// Parse ISO date format with Z for UTC
|
||||
start_time = DateTime::parse_from_rfc3339(&attr_value)
|
||||
.ok()
|
||||
.map(|dt| dt.with_timezone(&Utc));
|
||||
} else if attr_name == "end" {
|
||||
end_time = DateTime::parse_from_rfc3339(&attr_value)
|
||||
.ok()
|
||||
.map(|dt| dt.with_timezone(&Utc));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -61,11 +61,14 @@ impl QualifiedName {
|
||||
}
|
||||
}
|
||||
|
||||
pub fn to_string(&self) -> String {
|
||||
}
|
||||
|
||||
impl std::fmt::Display for QualifiedName {
|
||||
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
||||
if self.namespace.is_empty() {
|
||||
self.name.clone()
|
||||
write!(f, "{}", self.name)
|
||||
} else {
|
||||
format!("{{{}}}{}", self.namespace, self.name)
|
||||
write!(f, "{{{}}}{}", self.namespace, self.name)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user