{"action":"created","issue":{"url":"https://api.github.com/repos/zeromq/netmq/issues/515","repository_url":"https://api.github.com/repos/zeromq/netmq","labels_url":"https://api.github.com/repos/zeromq/netmq/issues/515/labels{/name}","comments_url":"https://api.github.com/repos/zeromq/netmq/issues/515/comments","events_url":"https://api.github.com/repos/zeromq/netmq/issues/515/events","html_url":"https://github.com/zeromq/netmq/issues/515","id":142311075,"number":515,"title":"Exact match on Pub/Sub","user":{"login":"buybackoff","id":489852,"avatar_url":"https://avatars.githubusercontent.com/u/489852?v=3","gravatar_id":"","url":"https://api.github.com/users/buybackoff","html_url":"https://github.com/buybackoff","followers_url":"https://api.github.com/users/buybackoff/followers","following_url":"https://api.github.com/users/buybackoff/following{/other_user}","gists_url":"https://api.github.com/users/buybackoff/gists{/gist_id}","starred_url":"https://api.github.com/users/buybackoff/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/buybackoff/subscriptions","organizations_url":"https://api.github.com/users/buybackoff/orgs","repos_url":"https://api.github.com/users/buybackoff/repos","events_url":"https://api.github.com/users/buybackoff/events{/privacy}","received_events_url":"https://api.github.com/users/buybackoff/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":5,"created_at":"2016-03-21T10:41:00Z","updated_at":"2016-05-05T12:30:11Z","closed_at":"2016-05-04T18:53:45Z","body":"I have realized that often I use only exact matches in pub/sub, without wild cards and prefixes. Also, I remember from NanoMsg \"pitch\" that their subject matching was \"much more efficient\" due to using a radix tree vs simple trie in ZeroMQ.\r\n\r\nSo my question is: did someone profile how expensive is the trie search (e.g. as % of total CPU load) and how much memory it allocates vs a simple dictionary (on loopback and on LAN)? My use case is hundreds to low thousands topics maximum. However, I could easily reach a situation when I have a hundred very hot topics and double-digit Ks of cold topics that consume memory and slow down matching on the hot topics. Should I bother with constructing a benchmark, or network and other parts will always be a bottleneck even on localhost?\r\n\r\nOther than performance, I need to use a postfix to distinguish \"A\" and \"AB\" subject, e.g. add a vertical pipe: \"A|\" and \"AB|\".\r\n\r\nWe could add an option for this and use a different matching logic when the option is set.\r\n\r\n"},"comment":{"url":"https://api.github.com/repos/zeromq/netmq/issues/comments/217141061","html_url":"https://github.com/zeromq/netmq/issues/515#issuecomment-217141061","issue_url":"https://api.github.com/repos/zeromq/netmq/issues/515","id":217141061,"user":{"login":"buybackoff","id":489852,"avatar_url":"https://avatars.githubusercontent.com/u/489852?v=3","gravatar_id":"","url":"https://api.github.com/users/buybackoff","html_url":"https://github.com/buybackoff","followers_url":"https://api.github.com/users/buybackoff/followers","following_url":"https://api.github.com/users/buybackoff/following{/other_user}","gists_url":"https://api.github.com/users/buybackoff/gists{/gist_id}","starred_url":"https://api.github.com/users/buybackoff/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/buybackoff/subscriptions","organizations_url":"https://api.github.com/users/buybackoff/orgs","repos_url":"https://api.github.com/users/buybackoff/repos","events_url":"https://api.github.com/users/buybackoff/events{/privacy}","received_events_url":"https://api.github.com/users/buybackoff/received_events","type":"User","site_admin":false},"created_at":"2016-05-05T12:30:11Z","updated_at":"2016-05-05T12:30:11Z","body":"Do you think a strongly-typed derived classes of XPub/XSub could be a solution? Or, there could be a different approach, e.g. used by NATS, where they just use an integer to substitute a string subject."}}