Skip to content

Commit 10dc1ac

Browse files
authored
perf(compile): reduce the parallel jobs execution in sketch compilation
1 parent b343770 commit 10dc1ac

File tree

1 file changed

+13
-20
lines changed

1 file changed

+13
-20
lines changed

internal/orchestrator/orchestrator.go

Lines changed: 13 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1158,27 +1158,20 @@ func compileUploadSketch(
11581158
server, getCompileResult := commands.CompilerServerToStreams(ctx, w, w, nil)
11591159

11601160
// TODO: add build cache
1161+
compileReq := rpc.CompileRequest{
1162+
Instance: inst,
1163+
Fqbn: fqbn,
1164+
SketchPath: sketchPath,
1165+
BuildPath: buildPath,
1166+
Jobs: 2,
1167+
}
11611168
if profile == "" {
1162-
err = srv.Compile(&rpc.CompileRequest{
1163-
Instance: inst,
1164-
Fqbn: fqbn,
1165-
SketchPath: sketchPath,
1166-
BuildPath: buildPath,
1167-
Libraries: []string{sketchPath + "/../../sketch-libraries"},
1168-
}, server)
1169-
if err != nil {
1170-
return err
1171-
}
1172-
} else {
1173-
err = srv.Compile(&rpc.CompileRequest{
1174-
Instance: inst,
1175-
Fqbn: fqbn,
1176-
SketchPath: sketchPath,
1177-
BuildPath: buildPath,
1178-
}, server)
1179-
if err != nil {
1180-
return err
1181-
}
1169+
compileReq.Libraries = []string{sketchPath + "/../../sketch-libraries"}
1170+
}
1171+
1172+
err = srv.Compile(&compileReq, server)
1173+
if err != nil {
1174+
return err
11821175
}
11831176

11841177
// Output compilations details

0 commit comments

Comments
 (0)