From 860d7839414e0d54dec01750b2d7688a75d37189 Mon Sep 17 00:00:00 2001 From: Stevan Andjelkovic Date: Tue, 3 Aug 2021 10:48:37 +0200 Subject: [PATCH] docs: add a note and reference to event loop design --- src/runtime-prototype/event-loop.org | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/runtime-prototype/event-loop.org b/src/runtime-prototype/event-loop.org index 661a1622..b31cd657 100644 --- a/src/runtime-prototype/event-loop.org +++ b/src/runtime-prototype/event-loop.org @@ -270,7 +270,10 @@ queue | __ __ __ | -. ... ls := ... // the event loop state, contains the event queue etc. for { - runHandlers(ls) + // NOTE: we used to run the handlers in random order to maximise coverage, + // but it turns out a lot of time is spent randomising and also randomness + // can potentially ruin branch predicition in the CPU. + runHandlers(ls) // TODO: which order do we run the handlers in? } } #+end_src go @@ -405,3 +408,4 @@ queue | __ __ __ | -. * Resources ** http://ithare.com/five-myths-used-in-golang-vs-node-js-debate/ ** [chat server implemented using select/poll/epoll/uring](https://github.com/robn/yoctochat) +** [Data-Oriented Design](https://dataorienteddesign.com/dodbook/)