Sorry for the negative vibe, I guess with an annotation you could keep
single threaded as the norm and add @Parallel to components which are slow.

Under the hood, all rendering is done via the RenderCommand interface which
could, in theory, be parallelized.

You'd probably have a pool of render threads for the parallel work. These
threads would need to be initialized and cleaned up and be able to access
per-thread values (including Environmentals and services etc). You could
probably record() any thread local actions on the request thread and
replay() them on the worker thread.

You'd need to consider ordering in cases when one component needs to render
after another (think @Environmental dependencies or DOM dependencies).

Since a thread-safe DOM will be slower, you'll want to check for @Parallel
and default to the faster DOM if no @Parallel is present.

Reply via email to