Skip to content

Commit 23ae6b1

Browse files
committed
Reenable profiling ci action
1 parent 9ef9b20 commit 23ae6b1

File tree

5 files changed

+19
-13
lines changed

5 files changed

+19
-13
lines changed

.github/workflows/comment-profiling-changes.yaml

-2
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,6 @@ env:
99

1010
jobs:
1111
profile:
12-
# TODO(TrueDoctor): Fix and reenable this action
13-
if: false
1412
runs-on: ubuntu-latest
1513
steps:
1614
- uses: actions/checkout@v3

node-graph/graph-craft/src/util.rs

+2-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,8 @@ use crate::proto::ProtoNetwork;
44

55
pub fn load_network(document_string: &str) -> NodeNetwork {
66
let document: serde_json::Value = serde_json::from_str(document_string).expect("Failed to parse document");
7-
serde_json::from_value::<NodeNetwork>(document["network_interface"]["network"].clone()).expect("Failed to parse document")
7+
let document = (document["network_interface"]["network"].clone()).to_string();
8+
serde_json::from_str::<NodeNetwork>(&document).expect("Failed to parse document")
89
}
910

1011
pub fn compile(network: NodeNetwork) -> ProtoNetwork {

node-graph/interpreted-executor/benches/run_cached.rs

+5-5
Original file line numberDiff line numberDiff line change
@@ -2,16 +2,16 @@ mod benchmark_util;
22

33
use benchmark_util::{bench_for_each_demo, setup_network};
44
use criterion::{Criterion, criterion_group, criterion_main};
5-
use graph_craft::graphene_compiler::Executor;
6-
use graphene_std::transform::Footprint;
5+
use graphene_std::Context;
76

87
fn subsequent_evaluations(c: &mut Criterion) {
98
let mut group = c.benchmark_group("Subsequent Evaluations");
10-
let footprint = Footprint::default();
9+
let context: Context = None;
1110
bench_for_each_demo(&mut group, |name, g| {
1211
let (executor, _) = setup_network(name);
13-
futures::executor::block_on((&executor).execute(criterion::black_box(footprint))).unwrap();
14-
g.bench_function(name, |b| b.iter(|| futures::executor::block_on((&executor).execute(criterion::black_box(footprint)))));
12+
g.bench_function(name, |b| {
13+
b.iter(|| futures::executor::block_on(executor.tree().eval_tagged_value(executor.output(), criterion::black_box(context.clone()))).unwrap())
14+
});
1515
});
1616
group.finish();
1717
}

node-graph/interpreted-executor/benches/run_once.rs

+3-4
Original file line numberDiff line numberDiff line change
@@ -2,17 +2,16 @@ mod benchmark_util;
22

33
use benchmark_util::{bench_for_each_demo, setup_network};
44
use criterion::{Criterion, criterion_group, criterion_main};
5-
use graph_craft::graphene_compiler::Executor;
6-
use graphene_std::transform::Footprint;
5+
use graphene_std::Context;
76

87
fn run_once(c: &mut Criterion) {
98
let mut group = c.benchmark_group("Run Once");
10-
let footprint = Footprint::default();
9+
let context: Context = None;
1110
bench_for_each_demo(&mut group, |name, g| {
1211
g.bench_function(name, |b| {
1312
b.iter_batched(
1413
|| setup_network(name),
15-
|(executor, _)| futures::executor::block_on((&executor).execute(criterion::black_box(footprint))),
14+
|(executor, _)| futures::executor::block_on(executor.tree().eval_tagged_value(executor.output(), criterion::black_box(context.clone()))).unwrap(),
1615
criterion::BatchSize::SmallInput,
1716
)
1817
});

node-graph/interpreted-executor/src/dynamic_executor.rs

+9-1
Original file line numberDiff line numberDiff line change
@@ -101,6 +101,14 @@ impl DynamicExecutor {
101101
self.typing_context.type_of(self.output).map(|node_io| node_io.call_argument.clone())
102102
}
103103

104+
pub fn tree(&self) -> &BorrowTree {
105+
&self.tree
106+
}
107+
108+
pub fn output(&self) -> NodeId {
109+
self.output
110+
}
111+
104112
pub fn output_type(&self) -> Option<Type> {
105113
self.typing_context.type_of(self.output).map(|node_io| node_io.return_value.clone())
106114
}
@@ -239,7 +247,7 @@ impl BorrowTree {
239247
/// This ensures that no borrowed data can escape the node graph.
240248
pub async fn eval_tagged_value<I>(&self, id: NodeId, input: I) -> Result<TaggedValue, String>
241249
where
242-
I: StaticType + 'static + Send + Sync + UnwindSafe,
250+
I: StaticType + 'static + Send + Sync,
243251
{
244252
let (node, _path) = self.nodes.get(&id).cloned().ok_or("Output node not found in executor")?;
245253
let output = node.eval(Box::new(input));

0 commit comments

Comments
 (0)