Hacker News new | ask | show | jobs
by cafxx 3151 days ago
Well, I guess because the runtime has to do a bunch of work to dispatch the events to the appropriate goroutine that is blocked waiting for that event. Switching and synchronization between goroutines is cheap, not free.
1 comments

And this solution does somehow not switch between goroutines?
No, the event loop is just one big goroutine that calls all the handlers directly.
Which...is the same as “not switch between goroutines” no?
Correct. I'm fairly certain he was agreeing with you.
(I think there was an edit)