{"action":"created","comment":{"url":"https://api.github.com/repos/dropbox/pyston/pulls/comments/27337267","id":27337267,"diff_hunk":"@@ -146,7 +146,7 @@ extern \"C\" PyObject* PyObject_SelfIter(PyObject* obj) noexcept {\n extern \"C\" int PyObject_GenericSetAttr(PyObject* obj, PyObject* name, PyObject* value) noexcept {\n     try {\n         if (value == NULL)\n-            delattrGeneric(obj, static_cast<BoxedString*>(name)->s, NULL);","path":"src/capi/object.cpp","position":4,"original_position":4,"commit_id":"0bc1c1b23b2731c3009875b33648420cf0172287","original_commit_id":"a0326d0df301ccc26dae30caf262bb2195ff4d35","user":{"login":"toshok","id":24245,"avatar_url":"https://avatars.githubusercontent.com/u/24245?v=3","gravatar_id":"","url":"https://api.github.com/users/toshok","html_url":"https://github.com/toshok","followers_url":"https://api.github.com/users/toshok/followers","following_url":"https://api.github.com/users/toshok/following{/other_user}","gists_url":"https://api.github.com/users/toshok/gists{/gist_id}","starred_url":"https://api.github.com/users/toshok/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/toshok/subscriptions","organizations_url":"https://api.github.com/users/toshok/orgs","repos_url":"https://api.github.com/users/toshok/repos","events_url":"https://api.github.com/users/toshok/events{/privacy}","received_events_url":"https://api.github.com/users/toshok/received_events","type":"User","site_admin":false},"body":"agreed.  we could also support llvm::Twine's, though those aren't as handy if callers aren't calling with concatenated strings.","created_at":"2015-03-27T23:02:14Z","updated_at":"2015-03-27T23:02:14Z","html_url":"https://github.com/dropbox/pyston/pull/411#discussion_r27337267","pull_request_url":"https://api.github.com/repos/dropbox/pyston/pulls/411","_links":{"self":{"href":"https://api.github.com/repos/dropbox/pyston/pulls/comments/27337267"},"html":{"href":"https://github.com/dropbox/pyston/pull/411#discussion_r27337267"},"pull_request":{"href":"https://api.github.com/repos/dropbox/pyston/pulls/411"}}},"pull_request":{"url":"https://api.github.com/repos/dropbox/pyston/pulls/411","id":31968160,"html_url":"https://github.com/dropbox/pyston/pull/411","diff_url":"https://github.com/dropbox/pyston/pull/411.diff","patch_url":"https://github.com/dropbox/pyston/pull/411.patch","issue_url":"https://api.github.com/repos/dropbox/pyston/issues/411","number":411,"state":"open","locked":false,"title":"colocate string and tuple data","user":{"login":"toshok","id":24245,"avatar_url":"https://avatars.githubusercontent.com/u/24245?v=3","gravatar_id":"","url":"https://api.github.com/users/toshok","html_url":"https://github.com/toshok","followers_url":"https://api.github.com/users/toshok/followers","following_url":"https://api.github.com/users/toshok/following{/other_user}","gists_url":"https://api.github.com/users/toshok/gists{/gist_id}","starred_url":"https://api.github.com/users/toshok/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/toshok/subscriptions","organizations_url":"https://api.github.com/users/toshok/orgs","repos_url":"https://api.github.com/users/toshok/repos","events_url":"https://api.github.com/users/toshok/events{/privacy}","received_events_url":"https://api.github.com/users/toshok/received_events","type":"User","site_admin":false},"body":"There's a lot of commits here, but most of them are squashable.  The crux of the change is both BoxedTuple and BoxedString have specialized `operator new`s that calculate the size of the Boxed structure as well as any additional data (Box*'s for the BoxedTuple, chars for BoxedString).\r\n\r\nThis should reduce the number of calls to our allocator by at least a half for these types.  In order to keep more of the BoxedString code the same, I added `pyston::String` which can mostly be described as \"an llvm::StringRef that exposes a std::string api\".  One difference is that `pyston::String`'s data can be owned (malloced/freed by pyston::String), which happens using `operator+`, etc.  It's normal mode is unowned (its use in BoxedString).\r\n\r\nAlso some effort goes to calculating the number of elements (tuple elements, characters) in the result before doing the allocation for the box, so we don't have to realloc.  This means we need non-ctor allocation paths (we already had them for BoxedString, in the boxString* family).  For BoxedTuple, I added static BoxedTuple::Create() overloads.\r\n\r\nperformance numbers initially were pretty crazy (-10% for interp2), but changes on master have brought them down to a more modest level (I haven't investigated to see which change(s) on master caused this.)  Current comparison shows:\r\n\r\n```\r\n              pyston (calibration)                      :    1.0s baseline: 1.0 (+0.0%)\r\n              pyston interp2.py                         :    3.8s baseline: 3.9 (-2.5%)\r\n              pyston raytrace.py                        :    6.4s baseline: 6.3 (+1.0%)\r\n              pyston nbody.py                           :    8.7s baseline: 8.5 (+2.7%)\r\n              pyston fannkuch.py                        :    6.6s baseline: 6.6 (+0.4%)\r\n              pyston chaos.py                           :   20.1s baseline: 19.9 (+1.4%)\r\n              pyston spectral_norm.py                   :   21.1s baseline: 22.5 (-6.2%)\r\n              pyston fasta.py                           :    4.9s baseline: 5.3 (-6.9%)\r\n              pyston pidigits.py                        :    5.1s baseline: 5.0 (+1.6%)\r\n              pyston richards.py                        :    1.9s baseline: 1.8 (+1.0%)\r\n              pyston deltablue.py                       :    2.0s baseline: 2.0 (-0.2%)\r\n              pyston (geomean-0b9f)                     :    6.0s baseline: 6.0 (-0.8%)\r\n```","created_at":"2015-03-25T21:32:13Z","updated_at":"2015-03-27T23:02:14Z","closed_at":null,"merged_at":null,"merge_commit_sha":"a49cf321239af3c71b6c7e05e4fba75e29c14972","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/dropbox/pyston/pulls/411/commits","review_comments_url":"https://api.github.com/repos/dropbox/pyston/pulls/411/comments","review_comment_url":"https://api.github.com/repos/dropbox/pyston/pulls/comments{/number}","comments_url":"https://api.github.com/repos/dropbox/pyston/issues/411/comments","statuses_url":"https://api.github.com/repos/dropbox/pyston/statuses/0bc1c1b23b2731c3009875b33648420cf0172287","head":{"label":"toshok:tuple-colocate3","ref":"tuple-colocate3","sha":"0bc1c1b23b2731c3009875b33648420cf0172287","user":{"login":"toshok","id":24245,"avatar_url":"https://avatars.githubusercontent.com/u/24245?v=3","gravatar_id":"","url":"https://api.github.com/users/toshok","html_url":"https://github.com/toshok","followers_url":"https://api.github.com/users/toshok/followers","following_url":"https://api.github.com/users/toshok/following{/other_user}","gists_url":"https://api.github.com/users/toshok/gists{/gist_id}","starred_url":"https://api.github.com/users/toshok/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/toshok/subscriptions","organizations_url":"https://api.github.com/users/toshok/orgs","repos_url":"https://api.github.com/users/toshok/repos","events_url":"https://api.github.com/users/toshok/events{/privacy}","received_events_url":"https://api.github.com/users/toshok/received_events","type":"User","site_admin":false},"repo":{"id":26560265,"name":"pyston","full_name":"toshok/pyston","owner":{"login":"toshok","id":24245,"avatar_url":"https://avatars.githubusercontent.com/u/24245?v=3","gravatar_id":"","url":"https://api.github.com/users/toshok","html_url":"https://github.com/toshok","followers_url":"https://api.github.com/users/toshok/followers","following_url":"https://api.github.com/users/toshok/following{/other_user}","gists_url":"https://api.github.com/users/toshok/gists{/gist_id}","starred_url":"https://api.github.com/users/toshok/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/toshok/subscriptions","organizations_url":"https://api.github.com/users/toshok/orgs","repos_url":"https://api.github.com/users/toshok/repos","events_url":"https://api.github.com/users/toshok/events{/privacy}","received_events_url":"https://api.github.com/users/toshok/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/toshok/pyston","description":"An open-source Python implementation using JIT techniques. ","fork":true,"url":"https://api.github.com/repos/toshok/pyston","forks_url":"https://api.github.com/repos/toshok/pyston/forks","keys_url":"https://api.github.com/repos/toshok/pyston/keys{/key_id}","collaborators_url":"https://api.github.com/repos/toshok/pyston/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/toshok/pyston/teams","hooks_url":"https://api.github.com/repos/toshok/pyston/hooks","issue_events_url":"https://api.github.com/repos/toshok/pyston/issues/events{/number}","events_url":"https://api.github.com/repos/toshok/pyston/events","assignees_url":"https://api.github.com/repos/toshok/pyston/assignees{/user}","branches_url":"https://api.github.com/repos/toshok/pyston/branches{/branch}","tags_url":"https://api.github.com/repos/toshok/pyston/tags","blobs_url":"https://api.github.com/repos/toshok/pyston/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/toshok/pyston/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/toshok/pyston/git/refs{/sha}","trees_url":"https://api.github.com/repos/toshok/pyston/git/trees{/sha}","statuses_url":"https://api.github.com/repos/toshok/pyston/statuses/{sha}","languages_url":"https://api.github.com/repos/toshok/pyston/languages","stargazers_url":"https://api.github.com/repos/toshok/pyston/stargazers","contributors_url":"https://api.github.com/repos/toshok/pyston/contributors","subscribers_url":"https://api.github.com/repos/toshok/pyston/subscribers","subscription_url":"https://api.github.com/repos/toshok/pyston/subscription","commits_url":"https://api.github.com/repos/toshok/pyston/commits{/sha}","git_commits_url":"https://api.github.com/repos/toshok/pyston/git/commits{/sha}","comments_url":"https://api.github.com/repos/toshok/pyston/comments{/number}","issue_comment_url":"https://api.github.com/repos/toshok/pyston/issues/comments{/number}","contents_url":"https://api.github.com/repos/toshok/pyston/contents/{+path}","compare_url":"https://api.github.com/repos/toshok/pyston/compare/{base}...{head}","merges_url":"https://api.github.com/repos/toshok/pyston/merges","archive_url":"https://api.github.com/repos/toshok/pyston/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/toshok/pyston/downloads","issues_url":"https://api.github.com/repos/toshok/pyston/issues{/number}","pulls_url":"https://api.github.com/repos/toshok/pyston/pulls{/number}","milestones_url":"https://api.github.com/repos/toshok/pyston/milestones{/number}","notifications_url":"https://api.github.com/repos/toshok/pyston/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/toshok/pyston/labels{/name}","releases_url":"https://api.github.com/repos/toshok/pyston/releases{/id}","created_at":"2014-11-12T22:56:58Z","updated_at":"2015-03-07T07:42:00Z","pushed_at":"2015-03-27T22:56:01Z","git_url":"git://github.com/toshok/pyston.git","ssh_url":"git@github.com:toshok/pyston.git","clone_url":"https://github.com/toshok/pyston.git","svn_url":"https://github.com/toshok/pyston","homepage":"https://tech.dropbox.com/2014/04/introducing-pyston-an-upcoming-jit-based-python-implementation/","size":16109,"stargazers_count":0,"watchers_count":0,"language":"Python","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"dropbox:master","ref":"master","sha":"7b9c46826c2953a482477e92a46798ba4c8d5c91","user":{"login":"dropbox","id":559357,"avatar_url":"https://avatars.githubusercontent.com/u/559357?v=3","gravatar_id":"","url":"https://api.github.com/users/dropbox","html_url":"https://github.com/dropbox","followers_url":"https://api.github.com/users/dropbox/followers","following_url":"https://api.github.com/users/dropbox/following{/other_user}","gists_url":"https://api.github.com/users/dropbox/gists{/gist_id}","starred_url":"https://api.github.com/users/dropbox/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dropbox/subscriptions","organizations_url":"https://api.github.com/users/dropbox/orgs","repos_url":"https://api.github.com/users/dropbox/repos","events_url":"https://api.github.com/users/dropbox/events{/privacy}","received_events_url":"https://api.github.com/users/dropbox/received_events","type":"Organization","site_admin":false},"repo":{"id":18320947,"name":"pyston","full_name":"dropbox/pyston","owner":{"login":"dropbox","id":559357,"avatar_url":"https://avatars.githubusercontent.com/u/559357?v=3","gravatar_id":"","url":"https://api.github.com/users/dropbox","html_url":"https://github.com/dropbox","followers_url":"https://api.github.com/users/dropbox/followers","following_url":"https://api.github.com/users/dropbox/following{/other_user}","gists_url":"https://api.github.com/users/dropbox/gists{/gist_id}","starred_url":"https://api.github.com/users/dropbox/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dropbox/subscriptions","organizations_url":"https://api.github.com/users/dropbox/orgs","repos_url":"https://api.github.com/users/dropbox/repos","events_url":"https://api.github.com/users/dropbox/events{/privacy}","received_events_url":"https://api.github.com/users/dropbox/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/dropbox/pyston","description":"An open-source Python implementation using JIT techniques. ","fork":false,"url":"https://api.github.com/repos/dropbox/pyston","forks_url":"https://api.github.com/repos/dropbox/pyston/forks","keys_url":"https://api.github.com/repos/dropbox/pyston/keys{/key_id}","collaborators_url":"https://api.github.com/repos/dropbox/pyston/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/dropbox/pyston/teams","hooks_url":"https://api.github.com/repos/dropbox/pyston/hooks","issue_events_url":"https://api.github.com/repos/dropbox/pyston/issues/events{/number}","events_url":"https://api.github.com/repos/dropbox/pyston/events","assignees_url":"https://api.github.com/repos/dropbox/pyston/assignees{/user}","branches_url":"https://api.github.com/repos/dropbox/pyston/branches{/branch}","tags_url":"https://api.github.com/repos/dropbox/pyston/tags","blobs_url":"https://api.github.com/repos/dropbox/pyston/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/dropbox/pyston/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/dropbox/pyston/git/refs{/sha}","trees_url":"https://api.github.com/repos/dropbox/pyston/git/trees{/sha}","statuses_url":"https://api.github.com/repos/dropbox/pyston/statuses/{sha}","languages_url":"https://api.github.com/repos/dropbox/pyston/languages","stargazers_url":"https://api.github.com/repos/dropbox/pyston/stargazers","contributors_url":"https://api.github.com/repos/dropbox/pyston/contributors","subscribers_url":"https://api.github.com/repos/dropbox/pyston/subscribers","subscription_url":"https://api.github.com/repos/dropbox/pyston/subscription","commits_url":"https://api.github.com/repos/dropbox/pyston/commits{/sha}","git_commits_url":"https://api.github.com/repos/dropbox/pyston/git/commits{/sha}","comments_url":"https://api.github.com/repos/dropbox/pyston/comments{/number}","issue_comment_url":"https://api.github.com/repos/dropbox/pyston/issues/comments{/number}","contents_url":"https://api.github.com/repos/dropbox/pyston/contents/{+path}","compare_url":"https://api.github.com/repos/dropbox/pyston/compare/{base}...{head}","merges_url":"https://api.github.com/repos/dropbox/pyston/merges","archive_url":"https://api.github.com/repos/dropbox/pyston/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/dropbox/pyston/downloads","issues_url":"https://api.github.com/repos/dropbox/pyston/issues{/number}","pulls_url":"https://api.github.com/repos/dropbox/pyston/pulls{/number}","milestones_url":"https://api.github.com/repos/dropbox/pyston/milestones{/number}","notifications_url":"https://api.github.com/repos/dropbox/pyston/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/dropbox/pyston/labels{/name}","releases_url":"https://api.github.com/repos/dropbox/pyston/releases{/id}","created_at":"2014-04-01T07:17:20Z","updated_at":"2015-03-27T22:46:01Z","pushed_at":"2015-03-27T22:56:02Z","git_url":"git://github.com/dropbox/pyston.git","ssh_url":"git@github.com:dropbox/pyston.git","clone_url":"https://github.com/dropbox/pyston.git","svn_url":"https://github.com/dropbox/pyston","homepage":"https://tech.dropbox.com/2014/04/introducing-pyston-an-upcoming-jit-based-python-implementation/","size":22574,"stargazers_count":2872,"watchers_count":2872,"language":"Python","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":206,"mirror_url":null,"open_issues_count":52,"forks":206,"open_issues":52,"watchers":2872,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/dropbox/pyston/pulls/411"},"html":{"href":"https://github.com/dropbox/pyston/pull/411"},"issue":{"href":"https://api.github.com/repos/dropbox/pyston/issues/411"},"comments":{"href":"https://api.github.com/repos/dropbox/pyston/issues/411/comments"},"review_comments":{"href":"https://api.github.com/repos/dropbox/pyston/pulls/411/comments"},"review_comment":{"href":"https://api.github.com/repos/dropbox/pyston/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/dropbox/pyston/pulls/411/commits"},"statuses":{"href":"https://api.github.com/repos/dropbox/pyston/statuses/0bc1c1b23b2731c3009875b33648420cf0172287"}}}}