fix: change where TaskHandle is borrowed to prevent repeat output fetches
This commit is contained in:
1 parent
c8efb00175
commit
9fbe4c2fd8
47 files changed
+323
-513
No files matched your search
@@ -46,7 +46,7 @@ pub fn bench_etl_pipeline(c: &mut Criterion) {
|
||||
})
|
||||
.count()
|
||||
}))
|
||||
.depends_on(extract);
|
||||
.depends_on(&extract);
|
||||
|
||||
// T2: Extract scores
|
||||
let scores = dag
|
||||
@@ -59,7 +59,7 @@ pub fn bench_etl_pipeline(c: &mut Criterion) {
|
||||
})
|
||||
.collect::<Vec<_>>()
|
||||
}))
|
||||
.depends_on(extract);
|
||||
.depends_on(&extract);
|
||||
|
||||
// T3: Extract names
|
||||
let names = dag
|
||||
@@ -73,7 +73,7 @@ pub fn bench_etl_pipeline(c: &mut Criterion) {
|
||||
})
|
||||
.collect::<Vec<_>>()
|
||||
}))
|
||||
.depends_on(extract);
|
||||
.depends_on(&extract);
|
||||
|
||||
// Load: Aggregate all transformations
|
||||
dag.add_task(task_fn::<(usize, Vec<_>, Vec<_>), _, _>(
|
||||
@@ -88,7 +88,7 @@ pub fn bench_etl_pipeline(c: &mut Criterion) {
|
||||
)
|
||||
},
|
||||
))
|
||||
.depends_on((validate, scores, names));
|
||||
.depends_on((&validate, &scores, &names));
|
||||
|
||||
let _output = dag
|
||||
.run(|fut| async move { tokio::spawn(fut).await.unwrap() })
|
||||
|
||||
@@ -36,7 +36,7 @@ pub fn bench_memory_efficiency(c: &mut Criterion) {
|
||||
.sum();
|
||||
black_box(sample_sum)
|
||||
}))
|
||||
.depends_on(source);
|
||||
.depends_on(&source);
|
||||
}
|
||||
|
||||
let _output = dag
|
||||
|
||||
@@ -23,17 +23,17 @@ pub fn bench_mixed_patterns(c: &mut Criterion) {
|
||||
.add_task(task_fn::<Vec<_>, _, _>(|d: &Vec<String>| {
|
||||
d.iter().filter(|s| s.contains("00")).count()
|
||||
}))
|
||||
.depends_on(data);
|
||||
.depends_on(&data);
|
||||
|
||||
let analysis2 = dag
|
||||
.add_task(task_fn::<Vec<_>, _, _>(|d: &Vec<String>| {
|
||||
d.iter().map(|s| s.len()).sum::<usize>()
|
||||
}))
|
||||
.depends_on(data);
|
||||
.depends_on(&data);
|
||||
|
||||
let analysis3 = dag
|
||||
.add_task(task_fn::<Vec<_>, _, _>(|d: &Vec<String>| d.len()))
|
||||
.depends_on(data);
|
||||
.depends_on(&data);
|
||||
|
||||
// Stage 3: Fan-in to aggregate
|
||||
let summary = dag
|
||||
@@ -42,14 +42,14 @@ pub fn bench_mixed_patterns(c: &mut Criterion) {
|
||||
format!("Matches: {}, Total bytes: {}, Count: {}", a1, a2, a3)
|
||||
},
|
||||
))
|
||||
.depends_on((analysis1, analysis2, analysis3));
|
||||
.depends_on((&analysis1, &analysis2, &analysis3));
|
||||
|
||||
// Stage 4: Fan-out final report to multiple destinations
|
||||
for i in 0..3 {
|
||||
dag.add_task(task_fn::<String, _, _>(move |report: &String| {
|
||||
format!("Destination {}: {}", i, report)
|
||||
}))
|
||||
.depends_on(summary);
|
||||
.depends_on(&summary);
|
||||
}
|
||||
|
||||
let _output = dag
|
||||
|
||||
Reference in new issue
Block a user