{"action":"created","comment":{"url":"https://api.github.com/repos/universal-ctags/ctags/pulls/comments/32826568","id":32826568,"diff_hunk":"@@ -300,20 +300,26 @@ static const char *skipEverything (const char *cp)\n \t\t\tmatch = 1;\n \n \t\t/* these checks find unicode, binary (Python 3) and raw strings */\n-\t\tif (!match && (\n-\t\t\t!strncasecmp(cp, \"u'\", 2) || !strncasecmp(cp, \"u\\\"\", 2) ||\n-\t\t\t!strncasecmp(cp, \"r'\", 2) || !strncasecmp(cp, \"r\\\"\", 2) ||\n-\t\t\t!strncasecmp(cp, \"b'\", 2) || !strncasecmp(cp, \"b\\\"\", 2)))\n+\t\tif (!match && (*cp == 'u' || *cp == 'r' || *cp == 'b' ||\n+\t\t\t\t\t   *cp == 'U' || *cp == 'R' || *cp == 'B'))\n \t\t{\n-\t\t\tmatch = 1;\n-\t\t\tcp += 1;\n-\t\t}\n-\t\tif (!match && (\n-\t\t\t!strncasecmp(cp, \"ur'\", 3) || !strncasecmp(cp, \"ur\\\"\", 3) ||\n-\t\t\t!strncasecmp(cp, \"br'\", 3) || !strncasecmp(cp, \"br\\\"\", 3)))\n-\t\t{\n-\t\t\tmatch = 1;\n-\t\t\tcp += 2;\n+\t\t\tchar c1 = *(cp + 1);\n+\n+\t\t\tif (c1 == '\\'' || c1 == '\"')\n+\t\t\t{\n+\t\t\t\tmatch = 1;\n+\t\t\t\tcp += 1;\n+\t\t\t}\n+\t\t\telse if (*cp != 'r' && *cp != 'R' && (c1 == 'r' || c1 == 'R'))","path":"parsers/python.c","position":27,"original_position":27,"commit_id":"40a832b6a4a8768f6d7baec572948d4e897a7704","original_commit_id":"40a832b6a4a8768f6d7baec572948d4e897a7704","user":{"login":"techee","id":713965,"avatar_url":"https://avatars.githubusercontent.com/u/713965?v=3","gravatar_id":"","url":"https://api.github.com/users/techee","html_url":"https://github.com/techee","followers_url":"https://api.github.com/users/techee/followers","following_url":"https://api.github.com/users/techee/following{/other_user}","gists_url":"https://api.github.com/users/techee/gists{/gist_id}","starred_url":"https://api.github.com/users/techee/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/techee/subscriptions","organizations_url":"https://api.github.com/users/techee/orgs","repos_url":"https://api.github.com/users/techee/repos","events_url":"https://api.github.com/users/techee/events{/privacy}","received_events_url":"https://api.github.com/users/techee/received_events","type":"User","site_admin":false},"body":"@b4n Thanks, it looks nicer, I'll use this.","created_at":"2015-06-19T13:08:23Z","updated_at":"2015-06-19T13:08:23Z","html_url":"https://github.com/universal-ctags/ctags/pull/383#discussion_r32826568","pull_request_url":"https://api.github.com/repos/universal-ctags/ctags/pulls/383","_links":{"self":{"href":"https://api.github.com/repos/universal-ctags/ctags/pulls/comments/32826568"},"html":{"href":"https://github.com/universal-ctags/ctags/pull/383#discussion_r32826568"},"pull_request":{"href":"https://api.github.com/repos/universal-ctags/ctags/pulls/383"}}},"pull_request":{"url":"https://api.github.com/repos/universal-ctags/ctags/pulls/383","id":38031163,"html_url":"https://github.com/universal-ctags/ctags/pull/383","diff_url":"https://github.com/universal-ctags/ctags/pull/383.diff","patch_url":"https://github.com/universal-ctags/ctags/pull/383.patch","issue_url":"https://api.github.com/repos/universal-ctags/ctags/issues/383","number":383,"state":"open","locked":false,"title":"python: optimize skipEverything()","user":{"login":"techee","id":713965,"avatar_url":"https://avatars.githubusercontent.com/u/713965?v=3","gravatar_id":"","url":"https://api.github.com/users/techee","html_url":"https://github.com/techee","followers_url":"https://api.github.com/users/techee/followers","following_url":"https://api.github.com/users/techee/following{/other_user}","gists_url":"https://api.github.com/users/techee/gists{/gist_id}","starred_url":"https://api.github.com/users/techee/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/techee/subscriptions","organizations_url":"https://api.github.com/users/techee/orgs","repos_url":"https://api.github.com/users/techee/repos","events_url":"https://api.github.com/users/techee/events{/privacy}","received_events_url":"https://api.github.com/users/techee/received_events","type":"User","site_admin":false},"body":"Most of the time there's no start of a string which means all the 10\r\nstrcmp()s are done for every character of the input. This is very expensive:\r\nbefore this patch this function alone takes 55% of the parser time.\r\nWhen comparing by character (and avoiding further comparison if the first\r\ncharacter doesn't match), this function takes only 11% of the parser time\r\nso the performance of the parser nearly doubles.","created_at":"2015-06-18T17:23:35Z","updated_at":"2015-06-19T13:08:23Z","closed_at":null,"merged_at":null,"merge_commit_sha":"a759956b58159231d170306d5b5eee0c1fe78883","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/universal-ctags/ctags/pulls/383/commits","review_comments_url":"https://api.github.com/repos/universal-ctags/ctags/pulls/383/comments","review_comment_url":"https://api.github.com/repos/universal-ctags/ctags/pulls/comments{/number}","comments_url":"https://api.github.com/repos/universal-ctags/ctags/issues/383/comments","statuses_url":"https://api.github.com/repos/universal-ctags/ctags/statuses/40a832b6a4a8768f6d7baec572948d4e897a7704","head":{"label":"techee:python_optimize","ref":"python_optimize","sha":"40a832b6a4a8768f6d7baec572948d4e897a7704","user":{"login":"techee","id":713965,"avatar_url":"https://avatars.githubusercontent.com/u/713965?v=3","gravatar_id":"","url":"https://api.github.com/users/techee","html_url":"https://github.com/techee","followers_url":"https://api.github.com/users/techee/followers","following_url":"https://api.github.com/users/techee/following{/other_user}","gists_url":"https://api.github.com/users/techee/gists{/gist_id}","starred_url":"https://api.github.com/users/techee/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/techee/subscriptions","organizations_url":"https://api.github.com/users/techee/orgs","repos_url":"https://api.github.com/users/techee/repos","events_url":"https://api.github.com/users/techee/events{/privacy}","received_events_url":"https://api.github.com/users/techee/received_events","type":"User","site_admin":false},"repo":{"id":27652831,"name":"ctags","full_name":"techee/ctags","owner":{"login":"techee","id":713965,"avatar_url":"https://avatars.githubusercontent.com/u/713965?v=3","gravatar_id":"","url":"https://api.github.com/users/techee","html_url":"https://github.com/techee","followers_url":"https://api.github.com/users/techee/followers","following_url":"https://api.github.com/users/techee/following{/other_user}","gists_url":"https://api.github.com/users/techee/gists{/gist_id}","starred_url":"https://api.github.com/users/techee/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/techee/subscriptions","organizations_url":"https://api.github.com/users/techee/orgs","repos_url":"https://api.github.com/users/techee/repos","events_url":"https://api.github.com/users/techee/events{/privacy}","received_events_url":"https://api.github.com/users/techee/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/techee/ctags","description":"clone of official ctags repo with obj-c and css patches added","fork":true,"url":"https://api.github.com/repos/techee/ctags","forks_url":"https://api.github.com/repos/techee/ctags/forks","keys_url":"https://api.github.com/repos/techee/ctags/keys{/key_id}","collaborators_url":"https://api.github.com/repos/techee/ctags/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/techee/ctags/teams","hooks_url":"https://api.github.com/repos/techee/ctags/hooks","issue_events_url":"https://api.github.com/repos/techee/ctags/issues/events{/number}","events_url":"https://api.github.com/repos/techee/ctags/events","assignees_url":"https://api.github.com/repos/techee/ctags/assignees{/user}","branches_url":"https://api.github.com/repos/techee/ctags/branches{/branch}","tags_url":"https://api.github.com/repos/techee/ctags/tags","blobs_url":"https://api.github.com/repos/techee/ctags/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/techee/ctags/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/techee/ctags/git/refs{/sha}","trees_url":"https://api.github.com/repos/techee/ctags/git/trees{/sha}","statuses_url":"https://api.github.com/repos/techee/ctags/statuses/{sha}","languages_url":"https://api.github.com/repos/techee/ctags/languages","stargazers_url":"https://api.github.com/repos/techee/ctags/stargazers","contributors_url":"https://api.github.com/repos/techee/ctags/contributors","subscribers_url":"https://api.github.com/repos/techee/ctags/subscribers","subscription_url":"https://api.github.com/repos/techee/ctags/subscription","commits_url":"https://api.github.com/repos/techee/ctags/commits{/sha}","git_commits_url":"https://api.github.com/repos/techee/ctags/git/commits{/sha}","comments_url":"https://api.github.com/repos/techee/ctags/comments{/number}","issue_comment_url":"https://api.github.com/repos/techee/ctags/issues/comments{/number}","contents_url":"https://api.github.com/repos/techee/ctags/contents/{+path}","compare_url":"https://api.github.com/repos/techee/ctags/compare/{base}...{head}","merges_url":"https://api.github.com/repos/techee/ctags/merges","archive_url":"https://api.github.com/repos/techee/ctags/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/techee/ctags/downloads","issues_url":"https://api.github.com/repos/techee/ctags/issues{/number}","pulls_url":"https://api.github.com/repos/techee/ctags/pulls{/number}","milestones_url":"https://api.github.com/repos/techee/ctags/milestones{/number}","notifications_url":"https://api.github.com/repos/techee/ctags/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/techee/ctags/labels{/name}","releases_url":"https://api.github.com/repos/techee/ctags/releases{/id}","created_at":"2014-12-06T23:29:21Z","updated_at":"2014-12-06T23:29:24Z","pushed_at":"2015-06-18T17:22:25Z","git_url":"git://github.com/techee/ctags.git","ssh_url":"git@github.com:techee/ctags.git","clone_url":"https://github.com/techee/ctags.git","svn_url":"https://github.com/techee/ctags","homepage":"","size":4445,"stargazers_count":0,"watchers_count":0,"language":"C","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":"universal-ctags:master","ref":"master","sha":"2d5378490b6a00359ff22ab21b9cfb7eb457e5c3","user":{"login":"universal-ctags","id":9616766,"avatar_url":"https://avatars.githubusercontent.com/u/9616766?v=3","gravatar_id":"","url":"https://api.github.com/users/universal-ctags","html_url":"https://github.com/universal-ctags","followers_url":"https://api.github.com/users/universal-ctags/followers","following_url":"https://api.github.com/users/universal-ctags/following{/other_user}","gists_url":"https://api.github.com/users/universal-ctags/gists{/gist_id}","starred_url":"https://api.github.com/users/universal-ctags/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/universal-ctags/subscriptions","organizations_url":"https://api.github.com/users/universal-ctags/orgs","repos_url":"https://api.github.com/users/universal-ctags/repos","events_url":"https://api.github.com/users/universal-ctags/events{/privacy}","received_events_url":"https://api.github.com/users/universal-ctags/received_events","type":"Organization","site_admin":false},"repo":{"id":578839,"name":"ctags","full_name":"universal-ctags/ctags","owner":{"login":"universal-ctags","id":9616766,"avatar_url":"https://avatars.githubusercontent.com/u/9616766?v=3","gravatar_id":"","url":"https://api.github.com/users/universal-ctags","html_url":"https://github.com/universal-ctags","followers_url":"https://api.github.com/users/universal-ctags/followers","following_url":"https://api.github.com/users/universal-ctags/following{/other_user}","gists_url":"https://api.github.com/users/universal-ctags/gists{/gist_id}","starred_url":"https://api.github.com/users/universal-ctags/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/universal-ctags/subscriptions","organizations_url":"https://api.github.com/users/universal-ctags/orgs","repos_url":"https://api.github.com/users/universal-ctags/repos","events_url":"https://api.github.com/users/universal-ctags/events{/privacy}","received_events_url":"https://api.github.com/users/universal-ctags/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/universal-ctags/ctags","description":"A maintained ctags implementation","fork":false,"url":"https://api.github.com/repos/universal-ctags/ctags","forks_url":"https://api.github.com/repos/universal-ctags/ctags/forks","keys_url":"https://api.github.com/repos/universal-ctags/ctags/keys{/key_id}","collaborators_url":"https://api.github.com/repos/universal-ctags/ctags/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/universal-ctags/ctags/teams","hooks_url":"https://api.github.com/repos/universal-ctags/ctags/hooks","issue_events_url":"https://api.github.com/repos/universal-ctags/ctags/issues/events{/number}","events_url":"https://api.github.com/repos/universal-ctags/ctags/events","assignees_url":"https://api.github.com/repos/universal-ctags/ctags/assignees{/user}","branches_url":"https://api.github.com/repos/universal-ctags/ctags/branches{/branch}","tags_url":"https://api.github.com/repos/universal-ctags/ctags/tags","blobs_url":"https://api.github.com/repos/universal-ctags/ctags/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/universal-ctags/ctags/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/universal-ctags/ctags/git/refs{/sha}","trees_url":"https://api.github.com/repos/universal-ctags/ctags/git/trees{/sha}","statuses_url":"https://api.github.com/repos/universal-ctags/ctags/statuses/{sha}","languages_url":"https://api.github.com/repos/universal-ctags/ctags/languages","stargazers_url":"https://api.github.com/repos/universal-ctags/ctags/stargazers","contributors_url":"https://api.github.com/repos/universal-ctags/ctags/contributors","subscribers_url":"https://api.github.com/repos/universal-ctags/ctags/subscribers","subscription_url":"https://api.github.com/repos/universal-ctags/ctags/subscription","commits_url":"https://api.github.com/repos/universal-ctags/ctags/commits{/sha}","git_commits_url":"https://api.github.com/repos/universal-ctags/ctags/git/commits{/sha}","comments_url":"https://api.github.com/repos/universal-ctags/ctags/comments{/number}","issue_comment_url":"https://api.github.com/repos/universal-ctags/ctags/issues/comments{/number}","contents_url":"https://api.github.com/repos/universal-ctags/ctags/contents/{+path}","compare_url":"https://api.github.com/repos/universal-ctags/ctags/compare/{base}...{head}","merges_url":"https://api.github.com/repos/universal-ctags/ctags/merges","archive_url":"https://api.github.com/repos/universal-ctags/ctags/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/universal-ctags/ctags/downloads","issues_url":"https://api.github.com/repos/universal-ctags/ctags/issues{/number}","pulls_url":"https://api.github.com/repos/universal-ctags/ctags/pulls{/number}","milestones_url":"https://api.github.com/repos/universal-ctags/ctags/milestones{/number}","notifications_url":"https://api.github.com/repos/universal-ctags/ctags/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/universal-ctags/ctags/labels{/name}","releases_url":"https://api.github.com/repos/universal-ctags/ctags/releases{/id}","created_at":"2010-03-25T10:43:13Z","updated_at":"2015-06-19T04:48:27Z","pushed_at":"2015-06-19T03:00:04Z","git_url":"git://github.com/universal-ctags/ctags.git","ssh_url":"git@github.com:universal-ctags/ctags.git","clone_url":"https://github.com/universal-ctags/ctags.git","svn_url":"https://github.com/universal-ctags/ctags","homepage":"https://ctags.io","size":7695,"stargazers_count":190,"watchers_count":190,"language":"C","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":71,"mirror_url":null,"open_issues_count":47,"forks":71,"open_issues":47,"watchers":190,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/universal-ctags/ctags/pulls/383"},"html":{"href":"https://github.com/universal-ctags/ctags/pull/383"},"issue":{"href":"https://api.github.com/repos/universal-ctags/ctags/issues/383"},"comments":{"href":"https://api.github.com/repos/universal-ctags/ctags/issues/383/comments"},"review_comments":{"href":"https://api.github.com/repos/universal-ctags/ctags/pulls/383/comments"},"review_comment":{"href":"https://api.github.com/repos/universal-ctags/ctags/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/universal-ctags/ctags/pulls/383/commits"},"statuses":{"href":"https://api.github.com/repos/universal-ctags/ctags/statuses/40a832b6a4a8768f6d7baec572948d4e897a7704"}}}}