{"action":"created","comment":{"url":"https://api.github.com/repos/diseraluca/SingleMeshBlend/pulls/comments/202520468","pull_request_review_id":137243773,"id":202520468,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDIwMjUyMDQ2OA==","diff_hunk":"@@ -204,37 +204,44 @@ MThreadRetVal SingleBlendMeshDeformer::threadEvaluate(void * pParam)\n \tunsigned int start{ threadData->start };\n \tunsigned int end{ threadData->end };\n \n-\tMPointArray& vertexPositions{ data->vertexPositions };\n-\tMPointArray& blendVertexPositions{ data->blendVertexPositions };\n+\t//Operator [] on maya containers as  a non negligible overhead. By using pointer we can bypass it\n+\tMPoint* currentVertexPosition{ &data->vertexPositions[0] };\n+\tMVectorArray deltas{ data->deltas };\n \n \tfloat envelopeValue{ data->envelopeValue };\n \tdouble blendWeightValue{ data->blendWeightValue };\n \n-\t//MPointArray operator[] has a non-negligible overhead. \n-\t//Accessing the memory directly with pointers bypass that overhead.\n-\tunsigned int vertexCount{ vertexPositions.length() };\n-\tMPoint* currentVertexPosition{ &vertexPositions[0] };\n-\tMPoint* blendVertexPosition{ &blendVertexPositions[0] };\n-\n-\tfor (unsigned int vertexIndex{ start }; vertexIndex < end; vertexIndex++) {\n-\t\tMVector delta{ (*(blendVertexPosition + vertexIndex) - *(currentVertexPosition + vertexIndex)) * blendWeightValue * envelopeValue };\n-\t\tMPoint newPosition{ delta + *(currentVertexPosition + vertexIndex) };\n-\n-\t\t*(currentVertexPosition + vertexIndex) = newPosition;\n+\tunsigned int vertexCount{ data->vertexPositions.length() };\n+\tfor (unsigned int vertexIndex{ start }; vertexIndex < end; ++vertexIndex) {\n+\t\tcurrentVertexPosition[vertexIndex] = (deltas[vertexIndex] * blendWeightValue * envelopeValue) + currentVertexPosition[vertexIndex];","path":"SingleMeshBlend/SingleMeshBlend/SingleBlendMeshDeformer.cpp","position":null,"original_position":53,"commit_id":"48046512859f3a0bc0da3cf578878d674983c2b8","original_commit_id":"f7207b57f261535cee649d98e07089a14071408c","user":{"login":"giordi91","id":2525797,"node_id":"MDQ6VXNlcjI1MjU3OTc=","avatar_url":"https://avatars2.githubusercontent.com/u/2525797?v=4","gravatar_id":"","url":"https://api.github.com/users/giordi91","html_url":"https://github.com/giordi91","followers_url":"https://api.github.com/users/giordi91/followers","following_url":"https://api.github.com/users/giordi91/following{/other_user}","gists_url":"https://api.github.com/users/giordi91/gists{/gist_id}","starred_url":"https://api.github.com/users/giordi91/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/giordi91/subscriptions","organizations_url":"https://api.github.com/users/giordi91/orgs","repos_url":"https://api.github.com/users/giordi91/repos","events_url":"https://api.github.com/users/giordi91/events{/privacy}","received_events_url":"https://api.github.com/users/giordi91/received_events","type":"User","site_admin":false},"body":"blendWeightValue* envelopeValue is constant, you can compute that before the loop and use the same value. Probably the compiler is optimizing that by its own but good practice to do that anyway.","created_at":"2018-07-14T17:16:22Z","updated_at":"2018-07-14T17:16:23Z","html_url":"https://github.com/diseraluca/SingleMeshBlend/pull/8#discussion_r202520468","pull_request_url":"https://api.github.com/repos/diseraluca/SingleMeshBlend/pulls/8","author_association":"NONE","_links":{"self":{"href":"https://api.github.com/repos/diseraluca/SingleMeshBlend/pulls/comments/202520468"},"html":{"href":"https://github.com/diseraluca/SingleMeshBlend/pull/8#discussion_r202520468"},"pull_request":{"href":"https://api.github.com/repos/diseraluca/SingleMeshBlend/pulls/8"}}},"pull_request":{"url":"https://api.github.com/repos/diseraluca/SingleMeshBlend/pulls/8","id":201450349,"node_id":"MDExOlB1bGxSZXF1ZXN0MjAxNDUwMzQ5","html_url":"https://github.com/diseraluca/SingleMeshBlend/pull/8","diff_url":"https://github.com/diseraluca/SingleMeshBlend/pull/8.diff","patch_url":"https://github.com/diseraluca/SingleMeshBlend/pull/8.patch","issue_url":"https://api.github.com/repos/diseraluca/SingleMeshBlend/issues/8","number":8,"state":"open","locked":false,"title":"1.3.3","user":{"login":"diseraluca","id":39652885,"node_id":"MDQ6VXNlcjM5NjUyODg1","avatar_url":"https://avatars2.githubusercontent.com/u/39652885?v=4","gravatar_id":"","url":"https://api.github.com/users/diseraluca","html_url":"https://github.com/diseraluca","followers_url":"https://api.github.com/users/diseraluca/followers","following_url":"https://api.github.com/users/diseraluca/following{/other_user}","gists_url":"https://api.github.com/users/diseraluca/gists{/gist_id}","starred_url":"https://api.github.com/users/diseraluca/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/diseraluca/subscriptions","organizations_url":"https://api.github.com/users/diseraluca/orgs","repos_url":"https://api.github.com/users/diseraluca/repos","events_url":"https://api.github.com/users/diseraluca/events{/privacy}","received_events_url":"https://api.github.com/users/diseraluca/received_events","type":"User","site_admin":false},"body":"","created_at":"2018-07-14T12:43:22Z","updated_at":"2018-07-14T17:16:23Z","closed_at":null,"merged_at":null,"merge_commit_sha":"2434d69b8d101be3f5bbd698d292c53980da7551","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/diseraluca/SingleMeshBlend/pulls/8/commits","review_comments_url":"https://api.github.com/repos/diseraluca/SingleMeshBlend/pulls/8/comments","review_comment_url":"https://api.github.com/repos/diseraluca/SingleMeshBlend/pulls/comments{/number}","comments_url":"https://api.github.com/repos/diseraluca/SingleMeshBlend/issues/8/comments","statuses_url":"https://api.github.com/repos/diseraluca/SingleMeshBlend/statuses/48046512859f3a0bc0da3cf578878d674983c2b8","head":{"label":"diseraluca:1.3.3","ref":"1.3.3","sha":"48046512859f3a0bc0da3cf578878d674983c2b8","user":{"login":"diseraluca","id":39652885,"node_id":"MDQ6VXNlcjM5NjUyODg1","avatar_url":"https://avatars2.githubusercontent.com/u/39652885?v=4","gravatar_id":"","url":"https://api.github.com/users/diseraluca","html_url":"https://github.com/diseraluca","followers_url":"https://api.github.com/users/diseraluca/followers","following_url":"https://api.github.com/users/diseraluca/following{/other_user}","gists_url":"https://api.github.com/users/diseraluca/gists{/gist_id}","starred_url":"https://api.github.com/users/diseraluca/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/diseraluca/subscriptions","organizations_url":"https://api.github.com/users/diseraluca/orgs","repos_url":"https://api.github.com/users/diseraluca/repos","events_url":"https://api.github.com/users/diseraluca/events{/privacy}","received_events_url":"https://api.github.com/users/diseraluca/received_events","type":"User","site_admin":false},"repo":{"id":140612303,"node_id":"MDEwOlJlcG9zaXRvcnkxNDA2MTIzMDM=","name":"SingleMeshBlend","full_name":"diseraluca/SingleMeshBlend","owner":{"login":"diseraluca","id":39652885,"node_id":"MDQ6VXNlcjM5NjUyODg1","avatar_url":"https://avatars2.githubusercontent.com/u/39652885?v=4","gravatar_id":"","url":"https://api.github.com/users/diseraluca","html_url":"https://github.com/diseraluca","followers_url":"https://api.github.com/users/diseraluca/followers","following_url":"https://api.github.com/users/diseraluca/following{/other_user}","gists_url":"https://api.github.com/users/diseraluca/gists{/gist_id}","starred_url":"https://api.github.com/users/diseraluca/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/diseraluca/subscriptions","organizations_url":"https://api.github.com/users/diseraluca/orgs","repos_url":"https://api.github.com/users/diseraluca/repos","events_url":"https://api.github.com/users/diseraluca/events{/privacy}","received_events_url":"https://api.github.com/users/diseraluca/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/diseraluca/SingleMeshBlend","description":"A didactical project to get accustomated with plugin's optimization.","fork":false,"url":"https://api.github.com/repos/diseraluca/SingleMeshBlend","forks_url":"https://api.github.com/repos/diseraluca/SingleMeshBlend/forks","keys_url":"https://api.github.com/repos/diseraluca/SingleMeshBlend/keys{/key_id}","collaborators_url":"https://api.github.com/repos/diseraluca/SingleMeshBlend/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/diseraluca/SingleMeshBlend/teams","hooks_url":"https://api.github.com/repos/diseraluca/SingleMeshBlend/hooks","issue_events_url":"https://api.github.com/repos/diseraluca/SingleMeshBlend/issues/events{/number}","events_url":"https://api.github.com/repos/diseraluca/SingleMeshBlend/events","assignees_url":"https://api.github.com/repos/diseraluca/SingleMeshBlend/assignees{/user}","branches_url":"https://api.github.com/repos/diseraluca/SingleMeshBlend/branches{/branch}","tags_url":"https://api.github.com/repos/diseraluca/SingleMeshBlend/tags","blobs_url":"https://api.github.com/repos/diseraluca/SingleMeshBlend/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/diseraluca/SingleMeshBlend/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/diseraluca/SingleMeshBlend/git/refs{/sha}","trees_url":"https://api.github.com/repos/diseraluca/SingleMeshBlend/git/trees{/sha}","statuses_url":"https://api.github.com/repos/diseraluca/SingleMeshBlend/statuses/{sha}","languages_url":"https://api.github.com/repos/diseraluca/SingleMeshBlend/languages","stargazers_url":"https://api.github.com/repos/diseraluca/SingleMeshBlend/stargazers","contributors_url":"https://api.github.com/repos/diseraluca/SingleMeshBlend/contributors","subscribers_url":"https://api.github.com/repos/diseraluca/SingleMeshBlend/subscribers","subscription_url":"https://api.github.com/repos/diseraluca/SingleMeshBlend/subscription","commits_url":"https://api.github.com/repos/diseraluca/SingleMeshBlend/commits{/sha}","git_commits_url":"https://api.github.com/repos/diseraluca/SingleMeshBlend/git/commits{/sha}","comments_url":"https://api.github.com/repos/diseraluca/SingleMeshBlend/comments{/number}","issue_comment_url":"https://api.github.com/repos/diseraluca/SingleMeshBlend/issues/comments{/number}","contents_url":"https://api.github.com/repos/diseraluca/SingleMeshBlend/contents/{+path}","compare_url":"https://api.github.com/repos/diseraluca/SingleMeshBlend/compare/{base}...{head}","merges_url":"https://api.github.com/repos/diseraluca/SingleMeshBlend/merges","archive_url":"https://api.github.com/repos/diseraluca/SingleMeshBlend/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/diseraluca/SingleMeshBlend/downloads","issues_url":"https://api.github.com/repos/diseraluca/SingleMeshBlend/issues{/number}","pulls_url":"https://api.github.com/repos/diseraluca/SingleMeshBlend/pulls{/number}","milestones_url":"https://api.github.com/repos/diseraluca/SingleMeshBlend/milestones{/number}","notifications_url":"https://api.github.com/repos/diseraluca/SingleMeshBlend/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/diseraluca/SingleMeshBlend/labels{/name}","releases_url":"https://api.github.com/repos/diseraluca/SingleMeshBlend/releases{/id}","deployments_url":"https://api.github.com/repos/diseraluca/SingleMeshBlend/deployments","created_at":"2018-07-11T18:09:06Z","updated_at":"2018-07-13T22:22:24Z","pushed_at":"2018-07-14T12:43:23Z","git_url":"git://github.com/diseraluca/SingleMeshBlend.git","ssh_url":"git@github.com:diseraluca/SingleMeshBlend.git","clone_url":"https://github.com/diseraluca/SingleMeshBlend.git","svn_url":"https://github.com/diseraluca/SingleMeshBlend","homepage":null,"size":39,"stargazers_count":0,"watchers_count":0,"language":"C++","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"open_issues_count":2,"license":{"key":"mit","name":"MIT License","spdx_id":"MIT","url":"https://api.github.com/licenses/mit","node_id":"MDc6TGljZW5zZTEz"},"forks":0,"open_issues":2,"watchers":0,"default_branch":"master"}},"base":{"label":"diseraluca:master","ref":"master","sha":"7b548d105ac3f6728da9ec1330f29623e9de37b7","user":{"login":"diseraluca","id":39652885,"node_id":"MDQ6VXNlcjM5NjUyODg1","avatar_url":"https://avatars2.githubusercontent.com/u/39652885?v=4","gravatar_id":"","url":"https://api.github.com/users/diseraluca","html_url":"https://github.com/diseraluca","followers_url":"https://api.github.com/users/diseraluca/followers","following_url":"https://api.github.com/users/diseraluca/following{/other_user}","gists_url":"https://api.github.com/users/diseraluca/gists{/gist_id}","starred_url":"https://api.github.com/users/diseraluca/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/diseraluca/subscriptions","organizations_url":"https://api.github.com/users/diseraluca/orgs","repos_url":"https://api.github.com/users/diseraluca/repos","events_url":"https://api.github.com/users/diseraluca/events{/privacy}","received_events_url":"https://api.github.com/users/diseraluca/received_events","type":"User","site_admin":false},"repo":{"id":140612303,"node_id":"MDEwOlJlcG9zaXRvcnkxNDA2MTIzMDM=","name":"SingleMeshBlend","full_name":"diseraluca/SingleMeshBlend","owner":{"login":"diseraluca","id":39652885,"node_id":"MDQ6VXNlcjM5NjUyODg1","avatar_url":"https://avatars2.githubusercontent.com/u/39652885?v=4","gravatar_id":"","url":"https://api.github.com/users/diseraluca","html_url":"https://github.com/diseraluca","followers_url":"https://api.github.com/users/diseraluca/followers","following_url":"https://api.github.com/users/diseraluca/following{/other_user}","gists_url":"https://api.github.com/users/diseraluca/gists{/gist_id}","starred_url":"https://api.github.com/users/diseraluca/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/diseraluca/subscriptions","organizations_url":"https://api.github.com/users/diseraluca/orgs","repos_url":"https://api.github.com/users/diseraluca/repos","events_url":"https://api.github.com/users/diseraluca/events{/privacy}","received_events_url":"https://api.github.com/users/diseraluca/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/diseraluca/SingleMeshBlend","description":"A didactical project to get accustomated with plugin's optimization.","fork":false,"url":"https://api.github.com/repos/diseraluca/SingleMeshBlend","forks_url":"https://api.github.com/repos/diseraluca/SingleMeshBlend/forks","keys_url":"https://api.github.com/repos/diseraluca/SingleMeshBlend/keys{/key_id}","collaborators_url":"https://api.github.com/repos/diseraluca/SingleMeshBlend/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/diseraluca/SingleMeshBlend/teams","hooks_url":"https://api.github.com/repos/diseraluca/SingleMeshBlend/hooks","issue_events_url":"https://api.github.com/repos/diseraluca/SingleMeshBlend/issues/events{/number}","events_url":"https://api.github.com/repos/diseraluca/SingleMeshBlend/events","assignees_url":"https://api.github.com/repos/diseraluca/SingleMeshBlend/assignees{/user}","branches_url":"https://api.github.com/repos/diseraluca/SingleMeshBlend/branches{/branch}","tags_url":"https://api.github.com/repos/diseraluca/SingleMeshBlend/tags","blobs_url":"https://api.github.com/repos/diseraluca/SingleMeshBlend/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/diseraluca/SingleMeshBlend/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/diseraluca/SingleMeshBlend/git/refs{/sha}","trees_url":"https://api.github.com/repos/diseraluca/SingleMeshBlend/git/trees{/sha}","statuses_url":"https://api.github.com/repos/diseraluca/SingleMeshBlend/statuses/{sha}","languages_url":"https://api.github.com/repos/diseraluca/SingleMeshBlend/languages","stargazers_url":"https://api.github.com/repos/diseraluca/SingleMeshBlend/stargazers","contributors_url":"https://api.github.com/repos/diseraluca/SingleMeshBlend/contributors","subscribers_url":"https://api.github.com/repos/diseraluca/SingleMeshBlend/subscribers","subscription_url":"https://api.github.com/repos/diseraluca/SingleMeshBlend/subscription","commits_url":"https://api.github.com/repos/diseraluca/SingleMeshBlend/commits{/sha}","git_commits_url":"https://api.github.com/repos/diseraluca/SingleMeshBlend/git/commits{/sha}","comments_url":"https://api.github.com/repos/diseraluca/SingleMeshBlend/comments{/number}","issue_comment_url":"https://api.github.com/repos/diseraluca/SingleMeshBlend/issues/comments{/number}","contents_url":"https://api.github.com/repos/diseraluca/SingleMeshBlend/contents/{+path}","compare_url":"https://api.github.com/repos/diseraluca/SingleMeshBlend/compare/{base}...{head}","merges_url":"https://api.github.com/repos/diseraluca/SingleMeshBlend/merges","archive_url":"https://api.github.com/repos/diseraluca/SingleMeshBlend/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/diseraluca/SingleMeshBlend/downloads","issues_url":"https://api.github.com/repos/diseraluca/SingleMeshBlend/issues{/number}","pulls_url":"https://api.github.com/repos/diseraluca/SingleMeshBlend/pulls{/number}","milestones_url":"https://api.github.com/repos/diseraluca/SingleMeshBlend/milestones{/number}","notifications_url":"https://api.github.com/repos/diseraluca/SingleMeshBlend/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/diseraluca/SingleMeshBlend/labels{/name}","releases_url":"https://api.github.com/repos/diseraluca/SingleMeshBlend/releases{/id}","deployments_url":"https://api.github.com/repos/diseraluca/SingleMeshBlend/deployments","created_at":"2018-07-11T18:09:06Z","updated_at":"2018-07-13T22:22:24Z","pushed_at":"2018-07-14T12:43:23Z","git_url":"git://github.com/diseraluca/SingleMeshBlend.git","ssh_url":"git@github.com:diseraluca/SingleMeshBlend.git","clone_url":"https://github.com/diseraluca/SingleMeshBlend.git","svn_url":"https://github.com/diseraluca/SingleMeshBlend","homepage":null,"size":39,"stargazers_count":0,"watchers_count":0,"language":"C++","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"open_issues_count":2,"license":{"key":"mit","name":"MIT License","spdx_id":"MIT","url":"https://api.github.com/licenses/mit","node_id":"MDc6TGljZW5zZTEz"},"forks":0,"open_issues":2,"watchers":0,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/diseraluca/SingleMeshBlend/pulls/8"},"html":{"href":"https://github.com/diseraluca/SingleMeshBlend/pull/8"},"issue":{"href":"https://api.github.com/repos/diseraluca/SingleMeshBlend/issues/8"},"comments":{"href":"https://api.github.com/repos/diseraluca/SingleMeshBlend/issues/8/comments"},"review_comments":{"href":"https://api.github.com/repos/diseraluca/SingleMeshBlend/pulls/8/comments"},"review_comment":{"href":"https://api.github.com/repos/diseraluca/SingleMeshBlend/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/diseraluca/SingleMeshBlend/pulls/8/commits"},"statuses":{"href":"https://api.github.com/repos/diseraluca/SingleMeshBlend/statuses/48046512859f3a0bc0da3cf578878d674983c2b8"}},"author_association":"OWNER"}}
{"actor":{"display_login":"giordi91"}}