{"action":"created","comment":{"url":"https://api.github.com/repos/CAFDataProcessing/worker-markup/pulls/comments/204355384","pull_request_review_id":139418807,"id":204355384,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDIwNDM1NTM4NA==","diff_hunk":"@@ -166,7 +181,15 @@ else if (line.contains(\": \")) {\n                 else if (line.contains(\":*\")) {\n                     bodyIndex++;\n                     addStandardisedHeader(nattyParser, headersElement, lines, line, \":\\\\*\");\n-                }else {\n+                } // Only enter this block if we get a match i.e. line is \"On xxx, abc wrote:\"\n+                else if (containsWhatSearched(line)) {\n+                    if (matcher.find()) {\n+                        bodyIndex++;\n+                        addCondensedHeader(nattyParser, headersElement, line, matcher);\n+                    } else {\n+                        break;\n+                    }\n+                } else {","path":"worker-markup-core/src/main/java/com/github/cafdataprocessing/worker/markup/core/MarkupHeadersAndBody.java","position":97,"original_position":97,"commit_id":"9b7b20038506c875c50e308fb9645a785a04340b","original_commit_id":"9b7b20038506c875c50e308fb9645a785a04340b","user":{"login":"davidegph","id":39379792,"node_id":"MDQ6VXNlcjM5Mzc5Nzky","avatar_url":"https://avatars2.githubusercontent.com/u/39379792?v=4","gravatar_id":"","url":"https://api.github.com/users/davidegph","html_url":"https://github.com/davidegph","followers_url":"https://api.github.com/users/davidegph/followers","following_url":"https://api.github.com/users/davidegph/following{/other_user}","gists_url":"https://api.github.com/users/davidegph/gists{/gist_id}","starred_url":"https://api.github.com/users/davidegph/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/davidegph/subscriptions","organizations_url":"https://api.github.com/users/davidegph/orgs","repos_url":"https://api.github.com/users/davidegph/repos","events_url":"https://api.github.com/users/davidegph/events{/privacy}","received_events_url":"https://api.github.com/users/davidegph/received_events","type":"User","site_admin":false},"body":"I have not joined the find with the method call, because I wanted to reduce the calls to matcher.find(). Since the pattern is very complex, a call with parallelstream(), anyMatch() and contains() could potentially save some time. ","created_at":"2018-07-23T10:38:41Z","updated_at":"2018-07-23T10:38:41Z","html_url":"https://github.com/CAFDataProcessing/worker-markup/pull/34#discussion_r204355384","pull_request_url":"https://api.github.com/repos/CAFDataProcessing/worker-markup/pulls/34","author_association":"NONE","_links":{"self":{"href":"https://api.github.com/repos/CAFDataProcessing/worker-markup/pulls/comments/204355384"},"html":{"href":"https://github.com/CAFDataProcessing/worker-markup/pull/34#discussion_r204355384"},"pull_request":{"href":"https://api.github.com/repos/CAFDataProcessing/worker-markup/pulls/34"}},"in_reply_to_id":204172308},"pull_request":{"url":"https://api.github.com/repos/CAFDataProcessing/worker-markup/pulls/34","id":202862247,"node_id":"MDExOlB1bGxSZXF1ZXN0MjAyODYyMjQ3","html_url":"https://github.com/CAFDataProcessing/worker-markup/pull/34","diff_url":"https://github.com/CAFDataProcessing/worker-markup/pull/34.diff","patch_url":"https://github.com/CAFDataProcessing/worker-markup/pull/34.patch","issue_url":"https://api.github.com/repos/CAFDataProcessing/worker-markup/issues/34","number":34,"state":"open","locked":false,"title":"SCMOD-4347: Improve performance of Matcher.find()","user":{"login":"davidegph","id":39379792,"node_id":"MDQ6VXNlcjM5Mzc5Nzky","avatar_url":"https://avatars2.githubusercontent.com/u/39379792?v=4","gravatar_id":"","url":"https://api.github.com/users/davidegph","html_url":"https://github.com/davidegph","followers_url":"https://api.github.com/users/davidegph/followers","following_url":"https://api.github.com/users/davidegph/following{/other_user}","gists_url":"https://api.github.com/users/davidegph/gists{/gist_id}","starred_url":"https://api.github.com/users/davidegph/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/davidegph/subscriptions","organizations_url":"https://api.github.com/users/davidegph/orgs","repos_url":"https://api.github.com/users/davidegph/repos","events_url":"https://api.github.com/users/davidegph/events{/privacy}","received_events_url":"https://api.github.com/users/davidegph/received_events","type":"User","site_admin":false},"body":"https://jira.autonomy.com/browse/SCMOD-4347\r\n\r\n* Duplicated calls to Matcher.find() removed (see handleHeaderWithAsterisks() method)\r\n* Small modification to the regex pattern FROM_FIELD_WITH_ASTERISKS_SPLIT_ONTO_TWO_LINES_REGEX to use a possessive quantifier in the first group (I have tried also different quantifiers, but the changes from a performance point of view were not relevant)\r\n* In order to minimize the calls to matcher.find(), I have introduced checks that use String.contains() with usually a subset of what is checked in the patterns. For example, I check for \">\", \"*\" and \"\\n\", if they are found, then it is worthwhile to actually run the matcher, otherwise the call is skipped. In the condensedMultilangHeaders there is the \",\" character, which means that the check that I do to verify if any of them is present will most likely always be true (I doubt there are many emails without a comma)\r\n* In order to minimize the usage of the memory, I tried to reduce the creation of objects by using Matcher.reset() every time that it is possible.","created_at":"2018-07-20T14:15:42Z","updated_at":"2018-07-23T10:38:41Z","closed_at":null,"merged_at":null,"merge_commit_sha":"b3ede7db02156a44da39ecff2c82babf06767950","assignee":{"login":"dermot-hardy","id":20627297,"node_id":"MDQ6VXNlcjIwNjI3Mjk3","avatar_url":"https://avatars2.githubusercontent.com/u/20627297?v=4","gravatar_id":"","url":"https://api.github.com/users/dermot-hardy","html_url":"https://github.com/dermot-hardy","followers_url":"https://api.github.com/users/dermot-hardy/followers","following_url":"https://api.github.com/users/dermot-hardy/following{/other_user}","gists_url":"https://api.github.com/users/dermot-hardy/gists{/gist_id}","starred_url":"https://api.github.com/users/dermot-hardy/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dermot-hardy/subscriptions","organizations_url":"https://api.github.com/users/dermot-hardy/orgs","repos_url":"https://api.github.com/users/dermot-hardy/repos","events_url":"https://api.github.com/users/dermot-hardy/events{/privacy}","received_events_url":"https://api.github.com/users/dermot-hardy/received_events","type":"User","site_admin":false},"assignees":[{"login":"dermot-hardy","id":20627297,"node_id":"MDQ6VXNlcjIwNjI3Mjk3","avatar_url":"https://avatars2.githubusercontent.com/u/20627297?v=4","gravatar_id":"","url":"https://api.github.com/users/dermot-hardy","html_url":"https://github.com/dermot-hardy","followers_url":"https://api.github.com/users/dermot-hardy/followers","following_url":"https://api.github.com/users/dermot-hardy/following{/other_user}","gists_url":"https://api.github.com/users/dermot-hardy/gists{/gist_id}","starred_url":"https://api.github.com/users/dermot-hardy/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dermot-hardy/subscriptions","organizations_url":"https://api.github.com/users/dermot-hardy/orgs","repos_url":"https://api.github.com/users/dermot-hardy/repos","events_url":"https://api.github.com/users/dermot-hardy/events{/privacy}","received_events_url":"https://api.github.com/users/dermot-hardy/received_events","type":"User","site_admin":false}],"requested_reviewers":[],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/CAFDataProcessing/worker-markup/pulls/34/commits","review_comments_url":"https://api.github.com/repos/CAFDataProcessing/worker-markup/pulls/34/comments","review_comment_url":"https://api.github.com/repos/CAFDataProcessing/worker-markup/pulls/comments{/number}","comments_url":"https://api.github.com/repos/CAFDataProcessing/worker-markup/issues/34/comments","statuses_url":"https://api.github.com/repos/CAFDataProcessing/worker-markup/statuses/9b7b20038506c875c50e308fb9645a785a04340b","head":{"label":"CAFDataProcessing:SCMOD-4347","ref":"SCMOD-4347","sha":"9b7b20038506c875c50e308fb9645a785a04340b","user":{"login":"CAFDataProcessing","id":25511824,"node_id":"MDEyOk9yZ2FuaXphdGlvbjI1NTExODI0","avatar_url":"https://avatars0.githubusercontent.com/u/25511824?v=4","gravatar_id":"","url":"https://api.github.com/users/CAFDataProcessing","html_url":"https://github.com/CAFDataProcessing","followers_url":"https://api.github.com/users/CAFDataProcessing/followers","following_url":"https://api.github.com/users/CAFDataProcessing/following{/other_user}","gists_url":"https://api.github.com/users/CAFDataProcessing/gists{/gist_id}","starred_url":"https://api.github.com/users/CAFDataProcessing/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/CAFDataProcessing/subscriptions","organizations_url":"https://api.github.com/users/CAFDataProcessing/orgs","repos_url":"https://api.github.com/users/CAFDataProcessing/repos","events_url":"https://api.github.com/users/CAFDataProcessing/events{/privacy}","received_events_url":"https://api.github.com/users/CAFDataProcessing/received_events","type":"Organization","site_admin":false},"repo":{"id":90764620,"node_id":"MDEwOlJlcG9zaXRvcnk5MDc2NDYyMA==","name":"worker-markup","full_name":"CAFDataProcessing/worker-markup","owner":{"login":"CAFDataProcessing","id":25511824,"node_id":"MDEyOk9yZ2FuaXphdGlvbjI1NTExODI0","avatar_url":"https://avatars0.githubusercontent.com/u/25511824?v=4","gravatar_id":"","url":"https://api.github.com/users/CAFDataProcessing","html_url":"https://github.com/CAFDataProcessing","followers_url":"https://api.github.com/users/CAFDataProcessing/followers","following_url":"https://api.github.com/users/CAFDataProcessing/following{/other_user}","gists_url":"https://api.github.com/users/CAFDataProcessing/gists{/gist_id}","starred_url":"https://api.github.com/users/CAFDataProcessing/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/CAFDataProcessing/subscriptions","organizations_url":"https://api.github.com/users/CAFDataProcessing/orgs","repos_url":"https://api.github.com/users/CAFDataProcessing/repos","events_url":"https://api.github.com/users/CAFDataProcessing/events{/privacy}","received_events_url":"https://api.github.com/users/CAFDataProcessing/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/CAFDataProcessing/worker-markup","description":null,"fork":false,"url":"https://api.github.com/repos/CAFDataProcessing/worker-markup","forks_url":"https://api.github.com/repos/CAFDataProcessing/worker-markup/forks","keys_url":"https://api.github.com/repos/CAFDataProcessing/worker-markup/keys{/key_id}","collaborators_url":"https://api.github.com/repos/CAFDataProcessing/worker-markup/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/CAFDataProcessing/worker-markup/teams","hooks_url":"https://api.github.com/repos/CAFDataProcessing/worker-markup/hooks","issue_events_url":"https://api.github.com/repos/CAFDataProcessing/worker-markup/issues/events{/number}","events_url":"https://api.github.com/repos/CAFDataProcessing/worker-markup/events","assignees_url":"https://api.github.com/repos/CAFDataProcessing/worker-markup/assignees{/user}","branches_url":"https://api.github.com/repos/CAFDataProcessing/worker-markup/branches{/branch}","tags_url":"https://api.github.com/repos/CAFDataProcessing/worker-markup/tags","blobs_url":"https://api.github.com/repos/CAFDataProcessing/worker-markup/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/CAFDataProcessing/worker-markup/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/CAFDataProcessing/worker-markup/git/refs{/sha}","trees_url":"https://api.github.com/repos/CAFDataProcessing/worker-markup/git/trees{/sha}","statuses_url":"https://api.github.com/repos/CAFDataProcessing/worker-markup/statuses/{sha}","languages_url":"https://api.github.com/repos/CAFDataProcessing/worker-markup/languages","stargazers_url":"https://api.github.com/repos/CAFDataProcessing/worker-markup/stargazers","contributors_url":"https://api.github.com/repos/CAFDataProcessing/worker-markup/contributors","subscribers_url":"https://api.github.com/repos/CAFDataProcessing/worker-markup/subscribers","subscription_url":"https://api.github.com/repos/CAFDataProcessing/worker-markup/subscription","commits_url":"https://api.github.com/repos/CAFDataProcessing/worker-markup/commits{/sha}","git_commits_url":"https://api.github.com/repos/CAFDataProcessing/worker-markup/git/commits{/sha}","comments_url":"https://api.github.com/repos/CAFDataProcessing/worker-markup/comments{/number}","issue_comment_url":"https://api.github.com/repos/CAFDataProcessing/worker-markup/issues/comments{/number}","contents_url":"https://api.github.com/repos/CAFDataProcessing/worker-markup/contents/{+path}","compare_url":"https://api.github.com/repos/CAFDataProcessing/worker-markup/compare/{base}...{head}","merges_url":"https://api.github.com/repos/CAFDataProcessing/worker-markup/merges","archive_url":"https://api.github.com/repos/CAFDataProcessing/worker-markup/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/CAFDataProcessing/worker-markup/downloads","issues_url":"https://api.github.com/repos/CAFDataProcessing/worker-markup/issues{/number}","pulls_url":"https://api.github.com/repos/CAFDataProcessing/worker-markup/pulls{/number}","milestones_url":"https://api.github.com/repos/CAFDataProcessing/worker-markup/milestones{/number}","notifications_url":"https://api.github.com/repos/CAFDataProcessing/worker-markup/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/CAFDataProcessing/worker-markup/labels{/name}","releases_url":"https://api.github.com/repos/CAFDataProcessing/worker-markup/releases{/id}","deployments_url":"https://api.github.com/repos/CAFDataProcessing/worker-markup/deployments","created_at":"2017-05-09T15:53:07Z","updated_at":"2018-07-05T12:59:03Z","pushed_at":"2018-07-20T14:15:43Z","git_url":"git://github.com/CAFDataProcessing/worker-markup.git","ssh_url":"git@github.com:CAFDataProcessing/worker-markup.git","clone_url":"https://github.com/CAFDataProcessing/worker-markup.git","svn_url":"https://github.com/CAFDataProcessing/worker-markup","homepage":null,"size":596,"stargazers_count":0,"watchers_count":0,"language":"Java","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":1,"license":{"key":"other","name":"Other","spdx_id":null,"url":null,"node_id":"MDc6TGljZW5zZTA="},"forks":0,"open_issues":1,"watchers":0,"default_branch":"develop"}},"base":{"label":"CAFDataProcessing:develop","ref":"develop","sha":"8d111a96354d8d300ac3a90bc97ff0e6b28ed964","user":{"login":"CAFDataProcessing","id":25511824,"node_id":"MDEyOk9yZ2FuaXphdGlvbjI1NTExODI0","avatar_url":"https://avatars0.githubusercontent.com/u/25511824?v=4","gravatar_id":"","url":"https://api.github.com/users/CAFDataProcessing","html_url":"https://github.com/CAFDataProcessing","followers_url":"https://api.github.com/users/CAFDataProcessing/followers","following_url":"https://api.github.com/users/CAFDataProcessing/following{/other_user}","gists_url":"https://api.github.com/users/CAFDataProcessing/gists{/gist_id}","starred_url":"https://api.github.com/users/CAFDataProcessing/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/CAFDataProcessing/subscriptions","organizations_url":"https://api.github.com/users/CAFDataProcessing/orgs","repos_url":"https://api.github.com/users/CAFDataProcessing/repos","events_url":"https://api.github.com/users/CAFDataProcessing/events{/privacy}","received_events_url":"https://api.github.com/users/CAFDataProcessing/received_events","type":"Organization","site_admin":false},"repo":{"id":90764620,"node_id":"MDEwOlJlcG9zaXRvcnk5MDc2NDYyMA==","name":"worker-markup","full_name":"CAFDataProcessing/worker-markup","owner":{"login":"CAFDataProcessing","id":25511824,"node_id":"MDEyOk9yZ2FuaXphdGlvbjI1NTExODI0","avatar_url":"https://avatars0.githubusercontent.com/u/25511824?v=4","gravatar_id":"","url":"https://api.github.com/users/CAFDataProcessing","html_url":"https://github.com/CAFDataProcessing","followers_url":"https://api.github.com/users/CAFDataProcessing/followers","following_url":"https://api.github.com/users/CAFDataProcessing/following{/other_user}","gists_url":"https://api.github.com/users/CAFDataProcessing/gists{/gist_id}","starred_url":"https://api.github.com/users/CAFDataProcessing/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/CAFDataProcessing/subscriptions","organizations_url":"https://api.github.com/users/CAFDataProcessing/orgs","repos_url":"https://api.github.com/users/CAFDataProcessing/repos","events_url":"https://api.github.com/users/CAFDataProcessing/events{/privacy}","received_events_url":"https://api.github.com/users/CAFDataProcessing/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/CAFDataProcessing/worker-markup","description":null,"fork":false,"url":"https://api.github.com/repos/CAFDataProcessing/worker-markup","forks_url":"https://api.github.com/repos/CAFDataProcessing/worker-markup/forks","keys_url":"https://api.github.com/repos/CAFDataProcessing/worker-markup/keys{/key_id}","collaborators_url":"https://api.github.com/repos/CAFDataProcessing/worker-markup/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/CAFDataProcessing/worker-markup/teams","hooks_url":"https://api.github.com/repos/CAFDataProcessing/worker-markup/hooks","issue_events_url":"https://api.github.com/repos/CAFDataProcessing/worker-markup/issues/events{/number}","events_url":"https://api.github.com/repos/CAFDataProcessing/worker-markup/events","assignees_url":"https://api.github.com/repos/CAFDataProcessing/worker-markup/assignees{/user}","branches_url":"https://api.github.com/repos/CAFDataProcessing/worker-markup/branches{/branch}","tags_url":"https://api.github.com/repos/CAFDataProcessing/worker-markup/tags","blobs_url":"https://api.github.com/repos/CAFDataProcessing/worker-markup/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/CAFDataProcessing/worker-markup/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/CAFDataProcessing/worker-markup/git/refs{/sha}","trees_url":"https://api.github.com/repos/CAFDataProcessing/worker-markup/git/trees{/sha}","statuses_url":"https://api.github.com/repos/CAFDataProcessing/worker-markup/statuses/{sha}","languages_url":"https://api.github.com/repos/CAFDataProcessing/worker-markup/languages","stargazers_url":"https://api.github.com/repos/CAFDataProcessing/worker-markup/stargazers","contributors_url":"https://api.github.com/repos/CAFDataProcessing/worker-markup/contributors","subscribers_url":"https://api.github.com/repos/CAFDataProcessing/worker-markup/subscribers","subscription_url":"https://api.github.com/repos/CAFDataProcessing/worker-markup/subscription","commits_url":"https://api.github.com/repos/CAFDataProcessing/worker-markup/commits{/sha}","git_commits_url":"https://api.github.com/repos/CAFDataProcessing/worker-markup/git/commits{/sha}","comments_url":"https://api.github.com/repos/CAFDataProcessing/worker-markup/comments{/number}","issue_comment_url":"https://api.github.com/repos/CAFDataProcessing/worker-markup/issues/comments{/number}","contents_url":"https://api.github.com/repos/CAFDataProcessing/worker-markup/contents/{+path}","compare_url":"https://api.github.com/repos/CAFDataProcessing/worker-markup/compare/{base}...{head}","merges_url":"https://api.github.com/repos/CAFDataProcessing/worker-markup/merges","archive_url":"https://api.github.com/repos/CAFDataProcessing/worker-markup/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/CAFDataProcessing/worker-markup/downloads","issues_url":"https://api.github.com/repos/CAFDataProcessing/worker-markup/issues{/number}","pulls_url":"https://api.github.com/repos/CAFDataProcessing/worker-markup/pulls{/number}","milestones_url":"https://api.github.com/repos/CAFDataProcessing/worker-markup/milestones{/number}","notifications_url":"https://api.github.com/repos/CAFDataProcessing/worker-markup/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/CAFDataProcessing/worker-markup/labels{/name}","releases_url":"https://api.github.com/repos/CAFDataProcessing/worker-markup/releases{/id}","deployments_url":"https://api.github.com/repos/CAFDataProcessing/worker-markup/deployments","created_at":"2017-05-09T15:53:07Z","updated_at":"2018-07-05T12:59:03Z","pushed_at":"2018-07-20T14:15:43Z","git_url":"git://github.com/CAFDataProcessing/worker-markup.git","ssh_url":"git@github.com:CAFDataProcessing/worker-markup.git","clone_url":"https://github.com/CAFDataProcessing/worker-markup.git","svn_url":"https://github.com/CAFDataProcessing/worker-markup","homepage":null,"size":596,"stargazers_count":0,"watchers_count":0,"language":"Java","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":1,"license":{"key":"other","name":"Other","spdx_id":null,"url":null,"node_id":"MDc6TGljZW5zZTA="},"forks":0,"open_issues":1,"watchers":0,"default_branch":"develop"}},"_links":{"self":{"href":"https://api.github.com/repos/CAFDataProcessing/worker-markup/pulls/34"},"html":{"href":"https://github.com/CAFDataProcessing/worker-markup/pull/34"},"issue":{"href":"https://api.github.com/repos/CAFDataProcessing/worker-markup/issues/34"},"comments":{"href":"https://api.github.com/repos/CAFDataProcessing/worker-markup/issues/34/comments"},"review_comments":{"href":"https://api.github.com/repos/CAFDataProcessing/worker-markup/pulls/34/comments"},"review_comment":{"href":"https://api.github.com/repos/CAFDataProcessing/worker-markup/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/CAFDataProcessing/worker-markup/pulls/34/commits"},"statuses":{"href":"https://api.github.com/repos/CAFDataProcessing/worker-markup/statuses/9b7b20038506c875c50e308fb9645a785a04340b"}},"author_association":"NONE"}}
{"actor":{"display_login":"davidegph"}}