{"action":"created","comment":{"url":"https://api.github.com/repos/EsotericSoftware/spine-runtimes/pulls/comments/25553794","id":25553794,"diff_hunk":"@@ -473,24 +689,59 @@ public class SkeletonRenderer : MonoBehaviour {\n #if UNITY_EDITOR\n \tvoid OnDrawGizmos () {\n \t\t// Make selection easier by drawing a clear gizmo over the skeleton.\n-\t\tif (vertices == null) return;\n-\t\tVector3 gizmosCenter = new Vector3();\n-\t\tVector3 gizmosSize = new Vector3();\n-\t\tVector3 min = new Vector3(float.MaxValue, float.MaxValue, 0f);\n-\t\tVector3 max = new Vector3(float.MinValue, float.MinValue, 0f);\n-\t\tforeach (Vector3 vert in vertices) {\n-\t\t\tmin = Vector3.Min(min, vert);\n-\t\t\tmax = Vector3.Max(max, vert);\n-\t\t}\n-\t\tfloat width = max.x - min.x;\n-\t\tfloat height = max.y - min.y;\n-\t\tgizmosCenter = new Vector3(min.x + (width / 2f), min.y + (height / 2f), 0f);\n-\t\tgizmosSize = new Vector3(width, height, 1f);\n+\t\tmeshFilter = GetComponent<MeshFilter>();\n+\t\tif (meshFilter == null) return;\n+\n+\t\tMesh mesh = meshFilter.sharedMesh;\n+\t\tif (mesh == null) return;\n+\n+\t\tBounds meshBounds = mesh.bounds;\n \t\tGizmos.color = Color.clear;\n \t\tGizmos.matrix = transform.localToWorldMatrix;\n-\t\tGizmos.DrawCube(gizmosCenter, gizmosSize);\n+\t\tGizmos.DrawCube(meshBounds.center, meshBounds.size);\n \t}\n #endif\n+\n+\tprivate class LastState {\n+\t\tpublic bool frontFacing;\n+\t\tpublic bool immutableTriangles;\n+\t\tpublic int vertexCount;\n+\t\tpublic readonly ExposedList<int> attachmentsTriangleCountTemp = new ExposedList<int>();\n+\t\tpublic readonly ExposedList<int> attachmentsTriangleCountMesh1 = new ExposedList<int>();\n+\t\tpublic readonly ExposedList<int> attachmentsTriangleCountMesh2 = new ExposedList<int>();\n+\t\tpublic readonly ExposedList<AddSubmeshArguments> addSubmeshArgumentsTemp = new ExposedList<AddSubmeshArguments>();\n+\t\tpublic readonly ExposedList<AddSubmeshArguments> addSubmeshArgumentsMesh1 = new ExposedList<AddSubmeshArguments>();\n+\t\tpublic readonly ExposedList<AddSubmeshArguments> addSubmeshArgumentsMesh2 = new ExposedList<AddSubmeshArguments>();\n+\n+\t\tpublic struct AddSubmeshArguments {\n+\t\t\tpublic Material material;\n+\t\t\tpublic int startSlot;\n+\t\t\tpublic int endSlot;\n+\t\t\tpublic int triangleCount;\n+\t\t\tpublic int firstVertex;\n+\t\t\tpublic bool lastSubmesh;\n+\n+\t\t\tpublic AddSubmeshArguments(Material material, int startSlot, int endSlot, int triangleCount, int firstVertex, bool lastSubmesh) {\n+\t\t\t\tthis.material = material;\n+\t\t\t\tthis.startSlot = startSlot;\n+\t\t\t\tthis.endSlot = endSlot;\n+\t\t\t\tthis.triangleCount = triangleCount;\n+\t\t\t\tthis.firstVertex = firstVertex;\n+\t\t\t\tthis.lastSubmesh = lastSubmesh;\n+\t\t\t}\n+\n+\t\t\tpublic bool Equals(AddSubmeshArguments other) {","path":"spine-unity/Assets/spine-unity/SkeletonRenderer.cs","position":639,"original_position":639,"commit_id":"be7480bca4369ca67101305097204557e5076ac0","original_commit_id":"be7480bca4369ca67101305097204557e5076ac0","user":{"login":"NathanSweet","id":434010,"avatar_url":"https://avatars.githubusercontent.com/u/434010?v=3","gravatar_id":"","url":"https://api.github.com/users/NathanSweet","html_url":"https://github.com/NathanSweet","followers_url":"https://api.github.com/users/NathanSweet/followers","following_url":"https://api.github.com/users/NathanSweet/following{/other_user}","gists_url":"https://api.github.com/users/NathanSweet/gists{/gist_id}","starred_url":"https://api.github.com/users/NathanSweet/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/NathanSweet/subscriptions","organizations_url":"https://api.github.com/users/NathanSweet/orgs","repos_url":"https://api.github.com/users/NathanSweet/repos","events_url":"https://api.github.com/users/NathanSweet/events{/privacy}","received_events_url":"https://api.github.com/users/NathanSweet/received_events","type":"User","site_admin":false},"body":"Would this be better passed by ref?","created_at":"2015-02-28T03:30:08Z","updated_at":"2015-02-28T03:30:08Z","html_url":"https://github.com/EsotericSoftware/spine-runtimes/pull/375#discussion_r25553794","pull_request_url":"https://api.github.com/repos/EsotericSoftware/spine-runtimes/pulls/375","_links":{"self":{"href":"https://api.github.com/repos/EsotericSoftware/spine-runtimes/pulls/comments/25553794"},"html":{"href":"https://github.com/EsotericSoftware/spine-runtimes/pull/375#discussion_r25553794"},"pull_request":{"href":"https://api.github.com/repos/EsotericSoftware/spine-runtimes/pulls/375"}}},"pull_request":{"url":"https://api.github.com/repos/EsotericSoftware/spine-runtimes/pulls/375","id":30050859,"html_url":"https://github.com/EsotericSoftware/spine-runtimes/pull/375","diff_url":"https://github.com/EsotericSoftware/spine-runtimes/pull/375.diff","patch_url":"https://github.com/EsotericSoftware/spine-runtimes/pull/375.patch","issue_url":"https://api.github.com/repos/EsotericSoftware/spine-runtimes/issues/375","number":375,"state":"open","locked":false,"title":"Reduced method call overhead","user":{"login":"LostPolygon","id":928550,"avatar_url":"https://avatars.githubusercontent.com/u/928550?v=3","gravatar_id":"","url":"https://api.github.com/users/LostPolygon","html_url":"https://github.com/LostPolygon","followers_url":"https://api.github.com/users/LostPolygon/followers","following_url":"https://api.github.com/users/LostPolygon/following{/other_user}","gists_url":"https://api.github.com/users/LostPolygon/gists{/gist_id}","starred_url":"https://api.github.com/users/LostPolygon/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/LostPolygon/subscriptions","organizations_url":"https://api.github.com/users/LostPolygon/orgs","repos_url":"https://api.github.com/users/LostPolygon/repos","events_url":"https://api.github.com/users/LostPolygon/events{/privacy}","received_events_url":"https://api.github.com/users/LostPolygon/received_events","type":"User","site_admin":false},"body":"Replaced most List<T> with ExposedList<T> that exposes the inner array in order to avoid the overhead of using the indexer. Manually inlined some stuff in SkeletonRenderer, and did some other microoptimizations.\r\nFor me, all this gave a 15-25% performance boost both on desktop and Android, in a stress-test of 70 characters that use bounding box attachments and meshes with FFD.","created_at":"2015-02-26T04:57:48Z","updated_at":"2015-02-28T03:30:08Z","closed_at":null,"merged_at":null,"merge_commit_sha":"89e1c7a8802723711c536e3fdae9c02b24addad0","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/EsotericSoftware/spine-runtimes/pulls/375/commits","review_comments_url":"https://api.github.com/repos/EsotericSoftware/spine-runtimes/pulls/375/comments","review_comment_url":"https://api.github.com/repos/EsotericSoftware/spine-runtimes/pulls/comments{/number}","comments_url":"https://api.github.com/repos/EsotericSoftware/spine-runtimes/issues/375/comments","statuses_url":"https://api.github.com/repos/EsotericSoftware/spine-runtimes/statuses/be7480bca4369ca67101305097204557e5076ac0","head":{"label":"LostPolygon:optimizations","ref":"optimizations","sha":"be7480bca4369ca67101305097204557e5076ac0","user":{"login":"LostPolygon","id":928550,"avatar_url":"https://avatars.githubusercontent.com/u/928550?v=3","gravatar_id":"","url":"https://api.github.com/users/LostPolygon","html_url":"https://github.com/LostPolygon","followers_url":"https://api.github.com/users/LostPolygon/followers","following_url":"https://api.github.com/users/LostPolygon/following{/other_user}","gists_url":"https://api.github.com/users/LostPolygon/gists{/gist_id}","starred_url":"https://api.github.com/users/LostPolygon/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/LostPolygon/subscriptions","organizations_url":"https://api.github.com/users/LostPolygon/orgs","repos_url":"https://api.github.com/users/LostPolygon/repos","events_url":"https://api.github.com/users/LostPolygon/events{/privacy}","received_events_url":"https://api.github.com/users/LostPolygon/received_events","type":"User","site_admin":false},"repo":{"id":22806108,"name":"spine-runtimes","full_name":"LostPolygon/spine-runtimes","owner":{"login":"LostPolygon","id":928550,"avatar_url":"https://avatars.githubusercontent.com/u/928550?v=3","gravatar_id":"","url":"https://api.github.com/users/LostPolygon","html_url":"https://github.com/LostPolygon","followers_url":"https://api.github.com/users/LostPolygon/followers","following_url":"https://api.github.com/users/LostPolygon/following{/other_user}","gists_url":"https://api.github.com/users/LostPolygon/gists{/gist_id}","starred_url":"https://api.github.com/users/LostPolygon/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/LostPolygon/subscriptions","organizations_url":"https://api.github.com/users/LostPolygon/orgs","repos_url":"https://api.github.com/users/LostPolygon/repos","events_url":"https://api.github.com/users/LostPolygon/events{/privacy}","received_events_url":"https://api.github.com/users/LostPolygon/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/LostPolygon/spine-runtimes","description":"2D skeletal animation runtimes for Spine.","fork":true,"url":"https://api.github.com/repos/LostPolygon/spine-runtimes","forks_url":"https://api.github.com/repos/LostPolygon/spine-runtimes/forks","keys_url":"https://api.github.com/repos/LostPolygon/spine-runtimes/keys{/key_id}","collaborators_url":"https://api.github.com/repos/LostPolygon/spine-runtimes/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/LostPolygon/spine-runtimes/teams","hooks_url":"https://api.github.com/repos/LostPolygon/spine-runtimes/hooks","issue_events_url":"https://api.github.com/repos/LostPolygon/spine-runtimes/issues/events{/number}","events_url":"https://api.github.com/repos/LostPolygon/spine-runtimes/events","assignees_url":"https://api.github.com/repos/LostPolygon/spine-runtimes/assignees{/user}","branches_url":"https://api.github.com/repos/LostPolygon/spine-runtimes/branches{/branch}","tags_url":"https://api.github.com/repos/LostPolygon/spine-runtimes/tags","blobs_url":"https://api.github.com/repos/LostPolygon/spine-runtimes/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/LostPolygon/spine-runtimes/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/LostPolygon/spine-runtimes/git/refs{/sha}","trees_url":"https://api.github.com/repos/LostPolygon/spine-runtimes/git/trees{/sha}","statuses_url":"https://api.github.com/repos/LostPolygon/spine-runtimes/statuses/{sha}","languages_url":"https://api.github.com/repos/LostPolygon/spine-runtimes/languages","stargazers_url":"https://api.github.com/repos/LostPolygon/spine-runtimes/stargazers","contributors_url":"https://api.github.com/repos/LostPolygon/spine-runtimes/contributors","subscribers_url":"https://api.github.com/repos/LostPolygon/spine-runtimes/subscribers","subscription_url":"https://api.github.com/repos/LostPolygon/spine-runtimes/subscription","commits_url":"https://api.github.com/repos/LostPolygon/spine-runtimes/commits{/sha}","git_commits_url":"https://api.github.com/repos/LostPolygon/spine-runtimes/git/commits{/sha}","comments_url":"https://api.github.com/repos/LostPolygon/spine-runtimes/comments{/number}","issue_comment_url":"https://api.github.com/repos/LostPolygon/spine-runtimes/issues/comments{/number}","contents_url":"https://api.github.com/repos/LostPolygon/spine-runtimes/contents/{+path}","compare_url":"https://api.github.com/repos/LostPolygon/spine-runtimes/compare/{base}...{head}","merges_url":"https://api.github.com/repos/LostPolygon/spine-runtimes/merges","archive_url":"https://api.github.com/repos/LostPolygon/spine-runtimes/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/LostPolygon/spine-runtimes/downloads","issues_url":"https://api.github.com/repos/LostPolygon/spine-runtimes/issues{/number}","pulls_url":"https://api.github.com/repos/LostPolygon/spine-runtimes/pulls{/number}","milestones_url":"https://api.github.com/repos/LostPolygon/spine-runtimes/milestones{/number}","notifications_url":"https://api.github.com/repos/LostPolygon/spine-runtimes/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/LostPolygon/spine-runtimes/labels{/name}","releases_url":"https://api.github.com/repos/LostPolygon/spine-runtimes/releases{/id}","created_at":"2014-08-10T09:51:54Z","updated_at":"2014-08-04T15:29:13Z","pushed_at":"2015-02-28T01:43:34Z","git_url":"git://github.com/LostPolygon/spine-runtimes.git","ssh_url":"git@github.com:LostPolygon/spine-runtimes.git","clone_url":"https://github.com/LostPolygon/spine-runtimes.git","svn_url":"https://github.com/LostPolygon/spine-runtimes","homepage":null,"size":26527,"stargazers_count":0,"watchers_count":0,"language":null,"has_issues":false,"has_downloads":true,"has_wiki":false,"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":"EsotericSoftware:master","ref":"master","sha":"194104f7425d809112da15ced506f8f863dc10b4","user":{"login":"EsotericSoftware","id":3641958,"avatar_url":"https://avatars.githubusercontent.com/u/3641958?v=3","gravatar_id":"","url":"https://api.github.com/users/EsotericSoftware","html_url":"https://github.com/EsotericSoftware","followers_url":"https://api.github.com/users/EsotericSoftware/followers","following_url":"https://api.github.com/users/EsotericSoftware/following{/other_user}","gists_url":"https://api.github.com/users/EsotericSoftware/gists{/gist_id}","starred_url":"https://api.github.com/users/EsotericSoftware/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/EsotericSoftware/subscriptions","organizations_url":"https://api.github.com/users/EsotericSoftware/orgs","repos_url":"https://api.github.com/users/EsotericSoftware/repos","events_url":"https://api.github.com/users/EsotericSoftware/events{/privacy}","received_events_url":"https://api.github.com/users/EsotericSoftware/received_events","type":"Organization","site_admin":false},"repo":{"id":8302181,"name":"spine-runtimes","full_name":"EsotericSoftware/spine-runtimes","owner":{"login":"EsotericSoftware","id":3641958,"avatar_url":"https://avatars.githubusercontent.com/u/3641958?v=3","gravatar_id":"","url":"https://api.github.com/users/EsotericSoftware","html_url":"https://github.com/EsotericSoftware","followers_url":"https://api.github.com/users/EsotericSoftware/followers","following_url":"https://api.github.com/users/EsotericSoftware/following{/other_user}","gists_url":"https://api.github.com/users/EsotericSoftware/gists{/gist_id}","starred_url":"https://api.github.com/users/EsotericSoftware/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/EsotericSoftware/subscriptions","organizations_url":"https://api.github.com/users/EsotericSoftware/orgs","repos_url":"https://api.github.com/users/EsotericSoftware/repos","events_url":"https://api.github.com/users/EsotericSoftware/events{/privacy}","received_events_url":"https://api.github.com/users/EsotericSoftware/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/EsotericSoftware/spine-runtimes","description":"2D skeletal animation runtimes for Spine.","fork":false,"url":"https://api.github.com/repos/EsotericSoftware/spine-runtimes","forks_url":"https://api.github.com/repos/EsotericSoftware/spine-runtimes/forks","keys_url":"https://api.github.com/repos/EsotericSoftware/spine-runtimes/keys{/key_id}","collaborators_url":"https://api.github.com/repos/EsotericSoftware/spine-runtimes/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/EsotericSoftware/spine-runtimes/teams","hooks_url":"https://api.github.com/repos/EsotericSoftware/spine-runtimes/hooks","issue_events_url":"https://api.github.com/repos/EsotericSoftware/spine-runtimes/issues/events{/number}","events_url":"https://api.github.com/repos/EsotericSoftware/spine-runtimes/events","assignees_url":"https://api.github.com/repos/EsotericSoftware/spine-runtimes/assignees{/user}","branches_url":"https://api.github.com/repos/EsotericSoftware/spine-runtimes/branches{/branch}","tags_url":"https://api.github.com/repos/EsotericSoftware/spine-runtimes/tags","blobs_url":"https://api.github.com/repos/EsotericSoftware/spine-runtimes/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/EsotericSoftware/spine-runtimes/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/EsotericSoftware/spine-runtimes/git/refs{/sha}","trees_url":"https://api.github.com/repos/EsotericSoftware/spine-runtimes/git/trees{/sha}","statuses_url":"https://api.github.com/repos/EsotericSoftware/spine-runtimes/statuses/{sha}","languages_url":"https://api.github.com/repos/EsotericSoftware/spine-runtimes/languages","stargazers_url":"https://api.github.com/repos/EsotericSoftware/spine-runtimes/stargazers","contributors_url":"https://api.github.com/repos/EsotericSoftware/spine-runtimes/contributors","subscribers_url":"https://api.github.com/repos/EsotericSoftware/spine-runtimes/subscribers","subscription_url":"https://api.github.com/repos/EsotericSoftware/spine-runtimes/subscription","commits_url":"https://api.github.com/repos/EsotericSoftware/spine-runtimes/commits{/sha}","git_commits_url":"https://api.github.com/repos/EsotericSoftware/spine-runtimes/git/commits{/sha}","comments_url":"https://api.github.com/repos/EsotericSoftware/spine-runtimes/comments{/number}","issue_comment_url":"https://api.github.com/repos/EsotericSoftware/spine-runtimes/issues/comments{/number}","contents_url":"https://api.github.com/repos/EsotericSoftware/spine-runtimes/contents/{+path}","compare_url":"https://api.github.com/repos/EsotericSoftware/spine-runtimes/compare/{base}...{head}","merges_url":"https://api.github.com/repos/EsotericSoftware/spine-runtimes/merges","archive_url":"https://api.github.com/repos/EsotericSoftware/spine-runtimes/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/EsotericSoftware/spine-runtimes/downloads","issues_url":"https://api.github.com/repos/EsotericSoftware/spine-runtimes/issues{/number}","pulls_url":"https://api.github.com/repos/EsotericSoftware/spine-runtimes/pulls{/number}","milestones_url":"https://api.github.com/repos/EsotericSoftware/spine-runtimes/milestones{/number}","notifications_url":"https://api.github.com/repos/EsotericSoftware/spine-runtimes/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/EsotericSoftware/spine-runtimes/labels{/name}","releases_url":"https://api.github.com/repos/EsotericSoftware/spine-runtimes/releases{/id}","created_at":"2013-02-19T23:49:37Z","updated_at":"2015-02-27T09:11:00Z","pushed_at":"2015-02-25T17:39:47Z","git_url":"git://github.com/EsotericSoftware/spine-runtimes.git","ssh_url":"git@github.com:EsotericSoftware/spine-runtimes.git","clone_url":"https://github.com/EsotericSoftware/spine-runtimes.git","svn_url":"https://github.com/EsotericSoftware/spine-runtimes","homepage":null,"size":29730,"stargazers_count":844,"watchers_count":844,"language":"C#","has_issues":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":803,"mirror_url":null,"open_issues_count":54,"forks":803,"open_issues":54,"watchers":844,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/EsotericSoftware/spine-runtimes/pulls/375"},"html":{"href":"https://github.com/EsotericSoftware/spine-runtimes/pull/375"},"issue":{"href":"https://api.github.com/repos/EsotericSoftware/spine-runtimes/issues/375"},"comments":{"href":"https://api.github.com/repos/EsotericSoftware/spine-runtimes/issues/375/comments"},"review_comments":{"href":"https://api.github.com/repos/EsotericSoftware/spine-runtimes/pulls/375/comments"},"review_comment":{"href":"https://api.github.com/repos/EsotericSoftware/spine-runtimes/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/EsotericSoftware/spine-runtimes/pulls/375/commits"},"statuses":{"href":"https://api.github.com/repos/EsotericSoftware/spine-runtimes/statuses/be7480bca4369ca67101305097204557e5076ac0"}}}}