I think our interestes in doing this are motivated by
- resilience (one server crashing does not stop students working).
- scalability (more students being able to attempt questions at the same time).
- maintenance (e.g. when you need to patch Linux, you can take one server down at a time, again without interrupting students).
rather than single-user performance. I would be very nervous about switching to asynchronous processing. The current code is simple, and therefore quite reliable, which are good properties to have. Getting asynchronous code right is hard. (Perhaps I am just a wimp.)
Anyway, I coded up this commit: https://github.com/trampgeek/moodle-qtype_coderunner/pull/24. (Thanks for the tip about where to set the job id.) However, we have not yet tested it with our load-balancer, so you may want to hold of merging it. Or, you coudl merge it now, and we can fix anything that needs fixing later.