{"action":"created","issue":{"url":"https://api.github.com/repos/JustinTulloss/zeromq.node/issues/499","repository_url":"https://api.github.com/repos/JustinTulloss/zeromq.node","labels_url":"https://api.github.com/repos/JustinTulloss/zeromq.node/issues/499/labels{/name}","comments_url":"https://api.github.com/repos/JustinTulloss/zeromq.node/issues/499/comments","events_url":"https://api.github.com/repos/JustinTulloss/zeromq.node/issues/499/events","html_url":"https://github.com/JustinTulloss/zeromq.node/pull/499","id":143253746,"number":499,"title":"Massive perf boost","user":{"login":"ronkorving","id":631240,"avatar_url":"https://avatars.githubusercontent.com/u/631240?v=3","gravatar_id":"","url":"https://api.github.com/users/ronkorving","html_url":"https://github.com/ronkorving","followers_url":"https://api.github.com/users/ronkorving/followers","following_url":"https://api.github.com/users/ronkorving/following{/other_user}","gists_url":"https://api.github.com/users/ronkorving/gists{/gist_id}","starred_url":"https://api.github.com/users/ronkorving/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ronkorving/subscriptions","organizations_url":"https://api.github.com/users/ronkorving/orgs","repos_url":"https://api.github.com/users/ronkorving/repos","events_url":"https://api.github.com/users/ronkorving/events{/privacy}","received_events_url":"https://api.github.com/users/ronkorving/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":16,"created_at":"2016-03-24T13:58:54Z","updated_at":"2016-03-25T13:00:55Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/JustinTulloss/zeromq.node/pulls/499","html_url":"https://github.com/JustinTulloss/zeromq.node/pull/499","diff_url":"https://github.com/JustinTulloss/zeromq.node/pull/499.diff","patch_url":"https://github.com/JustinTulloss/zeromq.node/pull/499.patch"},"body":"This PR almost triples the throughput on the perf test. Buffers are *still* being copied when sent, so there's still room for improvement, but I would say this is a nice start. Review very welcome (cc @kkoopa @reqshark, @gtamas), please be rigorous.\r\n\r\nBenchmark before:\r\n\r\n```\r\n$ make perf\r\nnode perf/local_lat.js tcp://127.0.0.1:5555 1 100000& node perf/remote_lat.js tcp://127.0.0.1:5555 1 100000\r\nstarted receiving\r\nmessage size: 1 [B]\r\nroundtrip count: 100000\r\nmean latency: 0.0733293089 [msecs]\r\noverall time: 14 secs and 665861780 nanoseconds\r\n\r\nnode perf/local_thr.js tcp://127.0.0.1:5556 1 100000& node perf/remote_thr.js tcp://127.0.0.1:5556 1 100000\r\nstarted receiving\r\nmessage size: 1 [B]\r\nmessage count: 100000\r\nmean throughput: 40431 [msg/s]\r\nmean throughput: 0 [Mbit/s]\r\noverall time: 2 secs and 473361003 nanoseconds\r\n```\r\n\r\nBenchmark after:\r\n\r\n```\r\n$ make perf\r\nnode perf/local_lat.js tcp://127.0.0.1:5555 1 100000& node perf/remote_lat.js tcp://127.0.0.1:5555 1 100000\r\nstarted receiving\r\nmessage size: 1 [B]\r\nroundtrip count: 100000\r\nmean latency: 0.07873620208 [msecs]\r\noverall time: 15 secs and 747240416 nanoseconds\r\n\r\nnode perf/local_thr.js tcp://127.0.0.1:5556 1 100000& node perf/remote_thr.js tcp://127.0.0.1:5556 1 100000\r\nstarted receiving\r\nmessage size: 1 [B]\r\nmessage count: 100000\r\nmean throughput: 115861 [msg/s]\r\nmean throughput: 1 [Mbit/s]\r\noverall time: 0 secs and 863099612 nanoseconds\r\n```"},"comment":{"url":"https://api.github.com/repos/JustinTulloss/zeromq.node/issues/comments/201269719","html_url":"https://github.com/JustinTulloss/zeromq.node/pull/499#issuecomment-201269719","issue_url":"https://api.github.com/repos/JustinTulloss/zeromq.node/issues/499","id":201269719,"user":{"login":"kkoopa","id":4103081,"avatar_url":"https://avatars.githubusercontent.com/u/4103081?v=3","gravatar_id":"","url":"https://api.github.com/users/kkoopa","html_url":"https://github.com/kkoopa","followers_url":"https://api.github.com/users/kkoopa/followers","following_url":"https://api.github.com/users/kkoopa/following{/other_user}","gists_url":"https://api.github.com/users/kkoopa/gists{/gist_id}","starred_url":"https://api.github.com/users/kkoopa/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kkoopa/subscriptions","organizations_url":"https://api.github.com/users/kkoopa/orgs","repos_url":"https://api.github.com/users/kkoopa/repos","events_url":"https://api.github.com/users/kkoopa/events{/privacy}","received_events_url":"https://api.github.com/users/kkoopa/received_events","type":"User","site_admin":false},"created_at":"2016-03-25T13:00:55Z","updated_at":"2016-03-25T13:00:55Z","body":"I was referring to dropping support for zmq 2 and 3. The reason 4 works better is because there are less calls to javascript, since they can only happen when uv_poll detects a change on the file descriptor, as opposed to after every send and recv.\n\nOn March 25, 2016 2:58:02 PM GMT+02:00, Ron Korving <notifications@github.com> wrote:\n>Sorry, what exactly is hiding the problem? The `IsReady` calls over the\n>`CallbackIfReady` calls? In other words, you're saying we need to\n>trigger `onReady` in JS? Because right now, the readv and sendv\n>functions loop to collect all message parts of a single message. That's\n>where I get a lot of performance from. Is this inherently wrong?\n>\n>---\n>You are receiving this because you were mentioned.\n>Reply to this email directly or view it on GitHub:\n>https://github.com/JustinTulloss/zeromq.node/pull/499#issuecomment-201268581\n"}}