Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unnecessary dynamic memory allocation in zmq_poller_poll() #2494

Merged
merged 1 commit into from
Apr 4, 2017
Merged

Unnecessary dynamic memory allocation in zmq_poller_poll() #2494

merged 1 commit into from
Apr 4, 2017

Conversation

bjovke
Copy link
Contributor

@bjovke bjovke commented Apr 4, 2017

While running asyncsrv.cpp C++ example on Windows, CPU usage is high.
CPU profiling in VS2015 Community shows that there are a lot of malloc/free operations done in zmq::poll() and zmq::proxy_steerable(). Most of malloc/free allocations are in zmq_poller_poll(), with new/delete.

This change removes unnecessary new/delete for zmq::socket_poller_t in zmq_poller_poll().
However, this needs further improvement for zmq_poller_event_t *events;.

…_poller_poll(). Fixed by allocating zmq::socket_poller_t from stack.
@bluca
Copy link
Member

bluca commented Apr 4, 2017

@bjovke thanks, could you please send a relicense agreement PR? See #2376

@somdoron I'm not 100% up to speed with the new poller stuff, does this look good for you?

@bluca bluca merged commit 26513b7 into zeromq:master Apr 4, 2017
@somdoron
Copy link
Member

somdoron commented Apr 4, 2017

Looks good

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants