[issue26233] select.epoll.wait() should away calling malloc() each time

2016-01-28 Thread STINNER Victor
STINNER Victor added the comment: > Any benchmarks? Wait, it's easier to write a patch than to cook a benchmark :-) Attached script bench_epoll_poll.py creates a lot of sockets and call epoll.poll() in non-blocking mode (timeout=0). You can decide to create or not events. It looks like perfo

[issue26233] select.epoll.wait() should away calling malloc() each time

2016-01-28 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Any benchmarks? -- ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: https://

[issue26233] select.epoll.wait() should away calling malloc() each time

2016-01-28 Thread STINNER Victor
STINNER Victor added the comment: I dislike allocating large memory block on the stack, we should not abuse it. I propose instead to store the memory block allocated on the heap in the epoll object. Attached patch implements this idea. The buffer is stolen from the epoll object when epoll.poll

[issue26233] select.epoll.wait() should away calling malloc() each time

2016-01-28 Thread STINNER Victor
New submission from STINNER Victor: My colleague Fabio M. Di Nitto noticed that the memory allocation on the heap (PyMem_Malloc()) in select.epoll.wait() can have an impact on performance when select.epoll.wait() is a busy applicatin. He proposed attached patch to allocate memory on the stack