Hacker News new | ask | show | jobs
by halayli 4060 days ago
This is a very inefficient way to handle events.

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.

1 comments

Maybe, 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.