summaryrefslogtreecommitdiffstats
path: root/src/server/Engine.cpp
diff options
context:
space:
mode:
authorDavid Robillard <d@drobilla.net>2016-10-01 15:18:09 -0400
committerDavid Robillard <d@drobilla.net>2016-10-01 17:49:08 -0400
commit98373a809cd82f254dddc7fd1eff9a6ec52c91b1 (patch)
tree3a4213bb891a3de06b52ae54f9f2c988ea808f33 /src/server/Engine.cpp
parent0bb80d1825d96b01156d12efc9a19a791710ab49 (diff)
downloadingen-98373a809cd82f254dddc7fd1eff9a6ec52c91b1.tar.gz
ingen-98373a809cd82f254dddc7fd1eff9a6ec52c91b1.tar.bz2
ingen-98373a809cd82f254dddc7fd1eff9a6ec52c91b1.zip
Defer graph compilation in atomic bundles
This avoids situations like compiling a graph hundreds of times when it is loaded because it has hundreds of nodes and each event triggers a re-compile. This speeds things up dramatically, but exacerbates the theoretical problem of there not being enough time in a cycle to execute a bundle. As far as I can tell, the execute phase of events is very fast, so hundreds or thousands can easily run in a tiny fraction of the process cycle, but this still needs resolution to be truly hard real-time. What probably needs to happen is that all context and state used to process is moved to CompiledGraph and nodes do not access their own fields at all, but have some references into the CompiledGraph. This way, a compiled graph is separate from its "source code", and an old one could continue to be run while a new one is beng applied across several cycles.
Diffstat (limited to 'src/server/Engine.cpp')
-rw-r--r--src/server/Engine.cpp8
1 files changed, 5 insertions, 3 deletions
diff --git a/src/server/Engine.cpp b/src/server/Engine.cpp
index bcad56a5..a8c51f20 100644
--- a/src/server/Engine.cpp
+++ b/src/server/Engine.cpp
@@ -47,6 +47,7 @@
#include "GraphImpl.hpp"
#include "LV2Options.hpp"
#include "PostProcessor.hpp"
+#include "PreProcessContext.hpp"
#include "PreProcessor.hpp"
#include "RunContext.hpp"
#include "ThreadManager.hpp"
@@ -374,9 +375,10 @@ Engine::activate()
*this, SPtr<Interface>(), -1, 0, Raul::Path("/"), graph_properties);
// Execute in "fake" process context (we are single threaded)
- RunContext context(run_context());
- ev.pre_process();
- ev.execute(context);
+ PreProcessContext pctx;
+ RunContext rctx(run_context());
+ ev.pre_process(pctx);
+ ev.execute(rctx);
ev.post_process();
_root_graph = ev.graph();