3 ms·
This is a very inefficient way to handle events. https://github.com/logcabin/logcabin/blob/master/Event/Loop.cc#L144-L154 https://github.com/logcabin/logcabin/
by halayli 11y ago
This is a very inefficient way to handle events.
https://github.com/logcabin/logcabin/blob/master/Event/Loop.cc#L144-L154 https://github.com/logcabin/logcabin/blob/master/Event/Loop....
an event can be read/write, and each fd:event_type should be able to map to a different Event::file.
In its current form, if you receive 2000 events, you'll need to unnecessarily context switch 2000 times.
- ongardie 11y agoMaybe, but I don't think it matters much. The comment there explains the issue, and I vaguely remember my measurements showing that this wasn't a big deal. I do think it's an interesting (dare I say) limitation of epoll, and something I'd think about if I was redesigning epoll. Please file an issue on github if you have ideas on how to improve this without adding significant complexity.