{"action":"created","issue":{"url":"https://api.github.com/repos/FreeOpcUa/python-opcua/issues/76","labels_url":"https://api.github.com/repos/FreeOpcUa/python-opcua/issues/76/labels{/name}","comments_url":"https://api.github.com/repos/FreeOpcUa/python-opcua/issues/76/comments","events_url":"https://api.github.com/repos/FreeOpcUa/python-opcua/issues/76/events","html_url":"https://github.com/FreeOpcUa/python-opcua/pull/76","id":123091912,"number":76,"title":"Performance enhancement","user":{"login":"huazh","id":12130700,"avatar_url":"https://avatars.githubusercontent.com/u/12130700?v=3","gravatar_id":"","url":"https://api.github.com/users/huazh","html_url":"https://github.com/huazh","followers_url":"https://api.github.com/users/huazh/followers","following_url":"https://api.github.com/users/huazh/following{/other_user}","gists_url":"https://api.github.com/users/huazh/gists{/gist_id}","starred_url":"https://api.github.com/users/huazh/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/huazh/subscriptions","organizations_url":"https://api.github.com/users/huazh/orgs","repos_url":"https://api.github.com/users/huazh/repos","events_url":"https://api.github.com/users/huazh/events{/privacy}","received_events_url":"https://api.github.com/users/huazh/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":16,"created_at":"2015-12-19T15:13:57Z","updated_at":"2015-12-20T08:12:34Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/FreeOpcUa/python-opcua/pulls/76","html_url":"https://github.com/FreeOpcUa/python-opcua/pull/76","diff_url":"https://github.com/FreeOpcUa/python-opcua/pull/76.diff","patch_url":"https://github.com/FreeOpcUa/python-opcua/pull/76.patch"},"body":"Hi,\r\nThis is a performance enhancement patch based on client read/write/subscribe profile. It speed up about 3~5 times depends on test case. I think it should speed up server application too.\r\nThe changes are:\r\n1, utils.Buffer don't truncate the saved data on each read(), just remember the reading position.\r\n2, remove class FrozenClass, using `__slots__` to restrict attributes access. Even though it is arguable using __slots__ to restrict access, but performance gain is huge here.\r\n3, rewrite auto generated class in uaprotocol_auto.py, make __init__ of them accept a data argument. if data is not None, it will initialize attribute from it as binary Buffer. It remove duplicated attribute initialization.\r\n4, rewrite pack/unpack code. inline direct pack/unpack function in Type object to/from_binary\r\n5, remove duplicated to_binary call in BinaryClient.send_request() as to_binary on big object is a heavy operation.\r\n"},"comment":{"url":"https://api.github.com/repos/FreeOpcUa/python-opcua/issues/comments/166081281","html_url":"https://github.com/FreeOpcUa/python-opcua/pull/76#issuecomment-166081281","issue_url":"https://api.github.com/repos/FreeOpcUa/python-opcua/issues/76","id":166081281,"user":{"login":"huazh","id":12130700,"avatar_url":"https://avatars.githubusercontent.com/u/12130700?v=3","gravatar_id":"","url":"https://api.github.com/users/huazh","html_url":"https://github.com/huazh","followers_url":"https://api.github.com/users/huazh/followers","following_url":"https://api.github.com/users/huazh/following{/other_user}","gists_url":"https://api.github.com/users/huazh/gists{/gist_id}","starred_url":"https://api.github.com/users/huazh/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/huazh/subscriptions","organizations_url":"https://api.github.com/users/huazh/orgs","repos_url":"https://api.github.com/users/huazh/repos","events_url":"https://api.github.com/users/huazh/events{/privacy}","received_events_url":"https://api.github.com/users/huazh/received_events","type":"User","site_admin":false},"created_at":"2015-12-20T08:12:34Z","updated_at":"2015-12-20T08:12:34Z","body":"You could merge the commit. It's test on Python2/3."}}