{"action":"created","comment":{"url":"https://api.github.com/repos/sebastianbergmann/phpunit/pulls/comments/168083605","pull_request_review_id":96392438,"id":168083605,"diff_hunk":"@@ -1133,19 +1133,28 @@ protected function runTest()\n             );\n         }\n \n-        try {\n-            $class  = new ReflectionClass($this);\n-            $method = $class->getMethod($this->name);\n-        } catch (ReflectionException $e) {\n-            $this->fail($e->getMessage());\n-        }\n-\n         $testArguments = \\array_merge($this->data, $this->dependencyInput);\n \n         $this->registerMockObjectsFromTestArguments($testArguments);\n \n         try {\n-            $testResult = $method->invokeArgs($this, $testArguments);\n+            // only use reflection to invoke the method if we have to\n+            if ($testArguments) {","path":"src/Framework/TestCase.php","position":18,"original_position":18,"commit_id":"7c433575ded9cb5163fb9e418ad334f4b7006877","original_commit_id":"7c433575ded9cb5163fb9e418ad334f4b7006877","user":{"login":"sebastianbergmann","id":25218,"avatar_url":"https://avatars1.githubusercontent.com/u/25218?v=4","gravatar_id":"","url":"https://api.github.com/users/sebastianbergmann","html_url":"https://github.com/sebastianbergmann","followers_url":"https://api.github.com/users/sebastianbergmann/followers","following_url":"https://api.github.com/users/sebastianbergmann/following{/other_user}","gists_url":"https://api.github.com/users/sebastianbergmann/gists{/gist_id}","starred_url":"https://api.github.com/users/sebastianbergmann/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sebastianbergmann/subscriptions","organizations_url":"https://api.github.com/users/sebastianbergmann/orgs","repos_url":"https://api.github.com/users/sebastianbergmann/repos","events_url":"https://api.github.com/users/sebastianbergmann/events{/privacy}","received_events_url":"https://api.github.com/users/sebastianbergmann/received_events","type":"User","site_admin":false},"body":"Definitely worth exploring. @jwage Do you want to look into this and update the pull request accordingly?","created_at":"2018-02-14T06:04:44Z","updated_at":"2018-02-14T06:04:44Z","html_url":"https://github.com/sebastianbergmann/phpunit/pull/3007#discussion_r168083605","pull_request_url":"https://api.github.com/repos/sebastianbergmann/phpunit/pulls/3007","author_association":"OWNER","_links":{"self":{"href":"https://api.github.com/repos/sebastianbergmann/phpunit/pulls/comments/168083605"},"html":{"href":"https://github.com/sebastianbergmann/phpunit/pull/3007#discussion_r168083605"},"pull_request":{"href":"https://api.github.com/repos/sebastianbergmann/phpunit/pulls/3007"}},"in_reply_to_id":168048059},"pull_request":{"url":"https://api.github.com/repos/sebastianbergmann/phpunit/pulls/3007","id":168924619,"html_url":"https://github.com/sebastianbergmann/phpunit/pull/3007","diff_url":"https://github.com/sebastianbergmann/phpunit/pull/3007.diff","patch_url":"https://github.com/sebastianbergmann/phpunit/pull/3007.patch","issue_url":"https://api.github.com/repos/sebastianbergmann/phpunit/issues/3007","number":3007,"state":"open","locked":false,"title":"Performance optimizations.","user":{"login":"jwage","id":97422,"avatar_url":"https://avatars0.githubusercontent.com/u/97422?v=4","gravatar_id":"","url":"https://api.github.com/users/jwage","html_url":"https://github.com/jwage","followers_url":"https://api.github.com/users/jwage/followers","following_url":"https://api.github.com/users/jwage/following{/other_user}","gists_url":"https://api.github.com/users/jwage/gists{/gist_id}","starred_url":"https://api.github.com/users/jwage/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jwage/subscriptions","organizations_url":"https://api.github.com/users/jwage/orgs","repos_url":"https://api.github.com/users/jwage/repos","events_url":"https://api.github.com/users/jwage/events{/privacy}","received_events_url":"https://api.github.com/users/jwage/received_events","type":"User","site_admin":false},"body":"@sebastianbergmann What do you think about these changes? In our test suite with 10000+ tests and 30000+ assertions, it gives us a 10-15% performance boost. If we can get rid of the method_exists call and just let PHP fail, it makes it a bit faster too.\r\n\r\nAnd see my comment in TestSuite.php. We have a base class we extend from that has many non test methods which end up getting passed to `addTestMethod` but I am not sure how we can make that work more generically.\r\n\r\n<img src=\"https://pbs.twimg.com/media/DV7O0nsVAAANcJu.jpg\" />\r\n\r\n<img src=\"https://pbs.twimg.com/media/DV7y-BSWkAMFsX0.jpg\" />","created_at":"2018-02-13T18:42:22Z","updated_at":"2018-02-14T06:04:44Z","closed_at":null,"merged_at":null,"merge_commit_sha":"32e144b37915ac54ff7aeadb7f39ae866dbc42ce","assignee":{"login":"sebastianbergmann","id":25218,"avatar_url":"https://avatars1.githubusercontent.com/u/25218?v=4","gravatar_id":"","url":"https://api.github.com/users/sebastianbergmann","html_url":"https://github.com/sebastianbergmann","followers_url":"https://api.github.com/users/sebastianbergmann/followers","following_url":"https://api.github.com/users/sebastianbergmann/following{/other_user}","gists_url":"https://api.github.com/users/sebastianbergmann/gists{/gist_id}","starred_url":"https://api.github.com/users/sebastianbergmann/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sebastianbergmann/subscriptions","organizations_url":"https://api.github.com/users/sebastianbergmann/orgs","repos_url":"https://api.github.com/users/sebastianbergmann/repos","events_url":"https://api.github.com/users/sebastianbergmann/events{/privacy}","received_events_url":"https://api.github.com/users/sebastianbergmann/received_events","type":"User","site_admin":false},"assignees":[{"login":"sebastianbergmann","id":25218,"avatar_url":"https://avatars1.githubusercontent.com/u/25218?v=4","gravatar_id":"","url":"https://api.github.com/users/sebastianbergmann","html_url":"https://github.com/sebastianbergmann","followers_url":"https://api.github.com/users/sebastianbergmann/followers","following_url":"https://api.github.com/users/sebastianbergmann/following{/other_user}","gists_url":"https://api.github.com/users/sebastianbergmann/gists{/gist_id}","starred_url":"https://api.github.com/users/sebastianbergmann/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sebastianbergmann/subscriptions","organizations_url":"https://api.github.com/users/sebastianbergmann/orgs","repos_url":"https://api.github.com/users/sebastianbergmann/repos","events_url":"https://api.github.com/users/sebastianbergmann/events{/privacy}","received_events_url":"https://api.github.com/users/sebastianbergmann/received_events","type":"User","site_admin":false}],"requested_reviewers":[],"requested_teams":[],"labels":[{"id":44002,"url":"https://api.github.com/repos/sebastianbergmann/phpunit/labels/enhancement","name":"enhancement","color":"009800","default":true}],"milestone":{"url":"https://api.github.com/repos/sebastianbergmann/phpunit/milestones/23","html_url":"https://github.com/sebastianbergmann/phpunit/milestone/23","labels_url":"https://api.github.com/repos/sebastianbergmann/phpunit/milestones/23/labels","id":2718611,"number":23,"title":"PHPUnit 7.1","description":"","creator":{"login":"sebastianbergmann","id":25218,"avatar_url":"https://avatars1.githubusercontent.com/u/25218?v=4","gravatar_id":"","url":"https://api.github.com/users/sebastianbergmann","html_url":"https://github.com/sebastianbergmann","followers_url":"https://api.github.com/users/sebastianbergmann/followers","following_url":"https://api.github.com/users/sebastianbergmann/following{/other_user}","gists_url":"https://api.github.com/users/sebastianbergmann/gists{/gist_id}","starred_url":"https://api.github.com/users/sebastianbergmann/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sebastianbergmann/subscriptions","organizations_url":"https://api.github.com/users/sebastianbergmann/orgs","repos_url":"https://api.github.com/users/sebastianbergmann/repos","events_url":"https://api.github.com/users/sebastianbergmann/events{/privacy}","received_events_url":"https://api.github.com/users/sebastianbergmann/received_events","type":"User","site_admin":false},"open_issues":2,"closed_issues":0,"state":"open","created_at":"2017-08-23T15:00:16Z","updated_at":"2018-02-13T20:28:45Z","due_on":"2018-04-06T07:00:00Z","closed_at":null},"commits_url":"https://api.github.com/repos/sebastianbergmann/phpunit/pulls/3007/commits","review_comments_url":"https://api.github.com/repos/sebastianbergmann/phpunit/pulls/3007/comments","review_comment_url":"https://api.github.com/repos/sebastianbergmann/phpunit/pulls/comments{/number}","comments_url":"https://api.github.com/repos/sebastianbergmann/phpunit/issues/3007/comments","statuses_url":"https://api.github.com/repos/sebastianbergmann/phpunit/statuses/7c433575ded9cb5163fb9e418ad334f4b7006877","head":{"label":"jwage:performance-optimizations","ref":"performance-optimizations","sha":"7c433575ded9cb5163fb9e418ad334f4b7006877","user":{"login":"jwage","id":97422,"avatar_url":"https://avatars0.githubusercontent.com/u/97422?v=4","gravatar_id":"","url":"https://api.github.com/users/jwage","html_url":"https://github.com/jwage","followers_url":"https://api.github.com/users/jwage/followers","following_url":"https://api.github.com/users/jwage/following{/other_user}","gists_url":"https://api.github.com/users/jwage/gists{/gist_id}","starred_url":"https://api.github.com/users/jwage/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jwage/subscriptions","organizations_url":"https://api.github.com/users/jwage/orgs","repos_url":"https://api.github.com/users/jwage/repos","events_url":"https://api.github.com/users/jwage/events{/privacy}","received_events_url":"https://api.github.com/users/jwage/received_events","type":"User","site_admin":false},"repo":{"id":121420594,"name":"phpunit","full_name":"jwage/phpunit","owner":{"login":"jwage","id":97422,"avatar_url":"https://avatars0.githubusercontent.com/u/97422?v=4","gravatar_id":"","url":"https://api.github.com/users/jwage","html_url":"https://github.com/jwage","followers_url":"https://api.github.com/users/jwage/followers","following_url":"https://api.github.com/users/jwage/following{/other_user}","gists_url":"https://api.github.com/users/jwage/gists{/gist_id}","starred_url":"https://api.github.com/users/jwage/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jwage/subscriptions","organizations_url":"https://api.github.com/users/jwage/orgs","repos_url":"https://api.github.com/users/jwage/repos","events_url":"https://api.github.com/users/jwage/events{/privacy}","received_events_url":"https://api.github.com/users/jwage/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/jwage/phpunit","description":"The PHP Unit Testing framework.","fork":true,"url":"https://api.github.com/repos/jwage/phpunit","forks_url":"https://api.github.com/repos/jwage/phpunit/forks","keys_url":"https://api.github.com/repos/jwage/phpunit/keys{/key_id}","collaborators_url":"https://api.github.com/repos/jwage/phpunit/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/jwage/phpunit/teams","hooks_url":"https://api.github.com/repos/jwage/phpunit/hooks","issue_events_url":"https://api.github.com/repos/jwage/phpunit/issues/events{/number}","events_url":"https://api.github.com/repos/jwage/phpunit/events","assignees_url":"https://api.github.com/repos/jwage/phpunit/assignees{/user}","branches_url":"https://api.github.com/repos/jwage/phpunit/branches{/branch}","tags_url":"https://api.github.com/repos/jwage/phpunit/tags","blobs_url":"https://api.github.com/repos/jwage/phpunit/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/jwage/phpunit/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/jwage/phpunit/git/refs{/sha}","trees_url":"https://api.github.com/repos/jwage/phpunit/git/trees{/sha}","statuses_url":"https://api.github.com/repos/jwage/phpunit/statuses/{sha}","languages_url":"https://api.github.com/repos/jwage/phpunit/languages","stargazers_url":"https://api.github.com/repos/jwage/phpunit/stargazers","contributors_url":"https://api.github.com/repos/jwage/phpunit/contributors","subscribers_url":"https://api.github.com/repos/jwage/phpunit/subscribers","subscription_url":"https://api.github.com/repos/jwage/phpunit/subscription","commits_url":"https://api.github.com/repos/jwage/phpunit/commits{/sha}","git_commits_url":"https://api.github.com/repos/jwage/phpunit/git/commits{/sha}","comments_url":"https://api.github.com/repos/jwage/phpunit/comments{/number}","issue_comment_url":"https://api.github.com/repos/jwage/phpunit/issues/comments{/number}","contents_url":"https://api.github.com/repos/jwage/phpunit/contents/{+path}","compare_url":"https://api.github.com/repos/jwage/phpunit/compare/{base}...{head}","merges_url":"https://api.github.com/repos/jwage/phpunit/merges","archive_url":"https://api.github.com/repos/jwage/phpunit/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/jwage/phpunit/downloads","issues_url":"https://api.github.com/repos/jwage/phpunit/issues{/number}","pulls_url":"https://api.github.com/repos/jwage/phpunit/pulls{/number}","milestones_url":"https://api.github.com/repos/jwage/phpunit/milestones{/number}","notifications_url":"https://api.github.com/repos/jwage/phpunit/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/jwage/phpunit/labels{/name}","releases_url":"https://api.github.com/repos/jwage/phpunit/releases{/id}","deployments_url":"https://api.github.com/repos/jwage/phpunit/deployments","created_at":"2018-02-13T18:36:38Z","updated_at":"2018-02-13T18:36:44Z","pushed_at":"2018-02-13T18:37:45Z","git_url":"git://github.com/jwage/phpunit.git","ssh_url":"git@github.com:jwage/phpunit.git","clone_url":"https://github.com/jwage/phpunit.git","svn_url":"https://github.com/jwage/phpunit","homepage":"https://phpunit.de/","size":25478,"stargazers_count":0,"watchers_count":0,"language":"PHP","has_issues":false,"has_projects":true,"has_downloads":false,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"open_issues_count":0,"license":null,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"sebastianbergmann:master","ref":"master","sha":"458cb3bda3f457ade8c447d6d08c8cdcbceb0e49","user":{"login":"sebastianbergmann","id":25218,"avatar_url":"https://avatars1.githubusercontent.com/u/25218?v=4","gravatar_id":"","url":"https://api.github.com/users/sebastianbergmann","html_url":"https://github.com/sebastianbergmann","followers_url":"https://api.github.com/users/sebastianbergmann/followers","following_url":"https://api.github.com/users/sebastianbergmann/following{/other_user}","gists_url":"https://api.github.com/users/sebastianbergmann/gists{/gist_id}","starred_url":"https://api.github.com/users/sebastianbergmann/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sebastianbergmann/subscriptions","organizations_url":"https://api.github.com/users/sebastianbergmann/orgs","repos_url":"https://api.github.com/users/sebastianbergmann/repos","events_url":"https://api.github.com/users/sebastianbergmann/events{/privacy}","received_events_url":"https://api.github.com/users/sebastianbergmann/received_events","type":"User","site_admin":false},"repo":{"id":448045,"name":"phpunit","full_name":"sebastianbergmann/phpunit","owner":{"login":"sebastianbergmann","id":25218,"avatar_url":"https://avatars1.githubusercontent.com/u/25218?v=4","gravatar_id":"","url":"https://api.github.com/users/sebastianbergmann","html_url":"https://github.com/sebastianbergmann","followers_url":"https://api.github.com/users/sebastianbergmann/followers","following_url":"https://api.github.com/users/sebastianbergmann/following{/other_user}","gists_url":"https://api.github.com/users/sebastianbergmann/gists{/gist_id}","starred_url":"https://api.github.com/users/sebastianbergmann/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sebastianbergmann/subscriptions","organizations_url":"https://api.github.com/users/sebastianbergmann/orgs","repos_url":"https://api.github.com/users/sebastianbergmann/repos","events_url":"https://api.github.com/users/sebastianbergmann/events{/privacy}","received_events_url":"https://api.github.com/users/sebastianbergmann/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/sebastianbergmann/phpunit","description":"The PHP Unit Testing framework.","fork":false,"url":"https://api.github.com/repos/sebastianbergmann/phpunit","forks_url":"https://api.github.com/repos/sebastianbergmann/phpunit/forks","keys_url":"https://api.github.com/repos/sebastianbergmann/phpunit/keys{/key_id}","collaborators_url":"https://api.github.com/repos/sebastianbergmann/phpunit/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/sebastianbergmann/phpunit/teams","hooks_url":"https://api.github.com/repos/sebastianbergmann/phpunit/hooks","issue_events_url":"https://api.github.com/repos/sebastianbergmann/phpunit/issues/events{/number}","events_url":"https://api.github.com/repos/sebastianbergmann/phpunit/events","assignees_url":"https://api.github.com/repos/sebastianbergmann/phpunit/assignees{/user}","branches_url":"https://api.github.com/repos/sebastianbergmann/phpunit/branches{/branch}","tags_url":"https://api.github.com/repos/sebastianbergmann/phpunit/tags","blobs_url":"https://api.github.com/repos/sebastianbergmann/phpunit/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/sebastianbergmann/phpunit/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/sebastianbergmann/phpunit/git/refs{/sha}","trees_url":"https://api.github.com/repos/sebastianbergmann/phpunit/git/trees{/sha}","statuses_url":"https://api.github.com/repos/sebastianbergmann/phpunit/statuses/{sha}","languages_url":"https://api.github.com/repos/sebastianbergmann/phpunit/languages","stargazers_url":"https://api.github.com/repos/sebastianbergmann/phpunit/stargazers","contributors_url":"https://api.github.com/repos/sebastianbergmann/phpunit/contributors","subscribers_url":"https://api.github.com/repos/sebastianbergmann/phpunit/subscribers","subscription_url":"https://api.github.com/repos/sebastianbergmann/phpunit/subscription","commits_url":"https://api.github.com/repos/sebastianbergmann/phpunit/commits{/sha}","git_commits_url":"https://api.github.com/repos/sebastianbergmann/phpunit/git/commits{/sha}","comments_url":"https://api.github.com/repos/sebastianbergmann/phpunit/comments{/number}","issue_comment_url":"https://api.github.com/repos/sebastianbergmann/phpunit/issues/comments{/number}","contents_url":"https://api.github.com/repos/sebastianbergmann/phpunit/contents/{+path}","compare_url":"https://api.github.com/repos/sebastianbergmann/phpunit/compare/{base}...{head}","merges_url":"https://api.github.com/repos/sebastianbergmann/phpunit/merges","archive_url":"https://api.github.com/repos/sebastianbergmann/phpunit/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/sebastianbergmann/phpunit/downloads","issues_url":"https://api.github.com/repos/sebastianbergmann/phpunit/issues{/number}","pulls_url":"https://api.github.com/repos/sebastianbergmann/phpunit/pulls{/number}","milestones_url":"https://api.github.com/repos/sebastianbergmann/phpunit/milestones{/number}","notifications_url":"https://api.github.com/repos/sebastianbergmann/phpunit/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/sebastianbergmann/phpunit/labels{/name}","releases_url":"https://api.github.com/repos/sebastianbergmann/phpunit/releases{/id}","deployments_url":"https://api.github.com/repos/sebastianbergmann/phpunit/deployments","created_at":"2009-12-24T13:16:23Z","updated_at":"2018-02-14T03:45:50Z","pushed_at":"2018-02-14T05:52:21Z","git_url":"git://github.com/sebastianbergmann/phpunit.git","ssh_url":"git@github.com:sebastianbergmann/phpunit.git","clone_url":"https://github.com/sebastianbergmann/phpunit.git","svn_url":"https://github.com/sebastianbergmann/phpunit","homepage":"https://phpunit.de/","size":25479,"stargazers_count":8177,"watchers_count":8177,"language":"PHP","has_issues":true,"has_projects":false,"has_downloads":false,"has_wiki":true,"has_pages":false,"forks_count":1546,"mirror_url":null,"archived":false,"open_issues_count":59,"license":{"key":"other","name":"Other","spdx_id":null,"url":null},"forks":1546,"open_issues":59,"watchers":8177,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/sebastianbergmann/phpunit/pulls/3007"},"html":{"href":"https://github.com/sebastianbergmann/phpunit/pull/3007"},"issue":{"href":"https://api.github.com/repos/sebastianbergmann/phpunit/issues/3007"},"comments":{"href":"https://api.github.com/repos/sebastianbergmann/phpunit/issues/3007/comments"},"review_comments":{"href":"https://api.github.com/repos/sebastianbergmann/phpunit/pulls/3007/comments"},"review_comment":{"href":"https://api.github.com/repos/sebastianbergmann/phpunit/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/sebastianbergmann/phpunit/pulls/3007/commits"},"statuses":{"href":"https://api.github.com/repos/sebastianbergmann/phpunit/statuses/7c433575ded9cb5163fb9e418ad334f4b7006877"}},"author_association":"NONE"}}
{"actor":{"display_login":"sebastianbergmann"}}