1

I have tried in this way:Create a server and a client in same PC , and send a packet from client to server.Once server side receive the packet , it sends the same packet back to client . I looped this for 1000,000 times and get the total consumed time and then take the average . To my surprise, the avg latency for 'select' is 33 micro secs while the latency for 'epoll' is only 10 micro secs. Since I only set up one connection , I did not expect 'epoll' latency is shorter . Is that reasonable ? Thanks.

Tim
  • 11
  • 2
  • 1
    Probably because `select()` needs to manipulate bitmaps. see [This document, comparing select with poll](http://daniel.haxx.se/docs/poll-vs-select.html) – Hasturkun Apr 25 '13 at 13:51
  • Possible duplicate of [With a single file descriptor, Is there any performance difference between select, poll and epoll and ...?](http://stackoverflow.com/questions/5647503/with-a-single-file-descriptor-is-there-any-performance-difference-between-selec) – gavv Jul 19 '16 at 14:07

0 Answers0