{"action":"created","issue":{"url":"https://api.github.com/repos/tavendo/AutobahnPython/issues/282","labels_url":"https://api.github.com/repos/tavendo/AutobahnPython/issues/282/labels{/name}","comments_url":"https://api.github.com/repos/tavendo/AutobahnPython/issues/282/comments","events_url":"https://api.github.com/repos/tavendo/AutobahnPython/issues/282/events","html_url":"https://github.com/tavendo/AutobahnPython/issues/282","id":46139338,"number":282,"title":"Old-style (classobj) classes may be slower on Pypy","user":{"login":"ldanielburr","id":732943,"avatar_url":"https://avatars.githubusercontent.com/u/732943?v=3","gravatar_id":"","url":"https://api.github.com/users/ldanielburr","html_url":"https://github.com/ldanielburr","followers_url":"https://api.github.com/users/ldanielburr/followers","following_url":"https://api.github.com/users/ldanielburr/following{/other_user}","gists_url":"https://api.github.com/users/ldanielburr/gists{/gist_id}","starred_url":"https://api.github.com/users/ldanielburr/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ldanielburr/subscriptions","organizations_url":"https://api.github.com/users/ldanielburr/orgs","repos_url":"https://api.github.com/users/ldanielburr/repos","events_url":"https://api.github.com/users/ldanielburr/events{/privacy}","received_events_url":"https://api.github.com/users/ldanielburr/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/tavendo/AutobahnPython/labels/enhancement","name":"enhancement","color":"33CCFF"},{"url":"https://api.github.com/repos/tavendo/AutobahnPython/labels/wamp","name":"wamp","color":"e102d8"},{"url":"https://api.github.com/repos/tavendo/AutobahnPython/labels/websocket","name":"websocket","color":"0b02e1"}],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":3,"created_at":"2014-10-17T20:15:02Z","updated_at":"2015-03-10T14:32:47Z","closed_at":"2015-03-10T14:14:08Z","body":"From http://pypy.org/performance.html:\r\n\r\n\"\"\"\r\nNew-style classes allow faster attribute access and take up less core per instance than old-style classes. Much of this advantage may be lost, however, if attribute names are not constant. For example: x.a = y or even setattr(x, ‘a’, y) will be much faster than a dynamic version: setattr(x, ‘a’ + some_variable, y).\r\n\r\nClasses that inherit from both new- and old-style classes are extremely slow; avoid at all costs.\r\n\r\nIn PyPy, isinstance() called against an old-style class was very slow until 2.0.\r\n\"\"\"\r\n\r\nBased on my perusal of the codebase, Autobahn is using old-style classes, and might benefit from a change to new-style classes, at least when running on Pypy.  Explicitly inheriting from object is valid in both Python 2 and Python 3, so this would be a fairly simple change to make.\r\n\r\nOne potential issue is the effect that switching to new-style classes may have on method-resolution-order in Autobahn classes that rely upon mixins."},"comment":{"url":"https://api.github.com/repos/tavendo/AutobahnPython/issues/comments/78065183","html_url":"https://github.com/tavendo/AutobahnPython/issues/282#issuecomment-78065183","issue_url":"https://api.github.com/repos/tavendo/AutobahnPython/issues/282","id":78065183,"user":{"login":"ldanielburr","id":732943,"avatar_url":"https://avatars.githubusercontent.com/u/732943?v=3","gravatar_id":"","url":"https://api.github.com/users/ldanielburr","html_url":"https://github.com/ldanielburr","followers_url":"https://api.github.com/users/ldanielburr/followers","following_url":"https://api.github.com/users/ldanielburr/following{/other_user}","gists_url":"https://api.github.com/users/ldanielburr/gists{/gist_id}","starred_url":"https://api.github.com/users/ldanielburr/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ldanielburr/subscriptions","organizations_url":"https://api.github.com/users/ldanielburr/orgs","repos_url":"https://api.github.com/users/ldanielburr/repos","events_url":"https://api.github.com/users/ldanielburr/events{/privacy}","received_events_url":"https://api.github.com/users/ldanielburr/received_events","type":"User","site_admin":false},"created_at":"2015-03-10T14:32:47Z","updated_at":"2015-03-10T14:32:47Z","body":"It will be interesting to see if this has a positive effect on performance under pypy."}}