{"action":"created","comment":{"url":"https://api.github.com/repos/ocaml/ocaml/pulls/comments/170882164","pull_request_review_id":99635195,"id":170882164,"diff_hunk":"@@ -100,15 +100,19 @@ let trim s =\n     then bts (B.trim (bos s))\n   else s\n \n+let needs_escape s =\n+  let n = length s in\n+  let i = ref 0 in\n+  let esc = ref false in\n+  while !i < n && not !esc do\n+    match unsafe_get s !i with\n+    | '\\\"' | '\\\\' | '\\000'..'\\031' | '\\127'.. '\\255' -> esc := true\n+    | _ -> incr i\n+  done;\n+  !esc","path":"stdlib/string.ml","position":13,"original_position":13,"commit_id":"d25eaa6f15efb32ec6b142b8d92cd3a01981413e","original_commit_id":"d25eaa6f15efb32ec6b142b8d92cd3a01981413e","user":{"login":"alainfrisch","id":3305274,"avatar_url":"https://avatars0.githubusercontent.com/u/3305274?v=4","gravatar_id":"","url":"https://api.github.com/users/alainfrisch","html_url":"https://github.com/alainfrisch","followers_url":"https://api.github.com/users/alainfrisch/followers","following_url":"https://api.github.com/users/alainfrisch/following{/other_user}","gists_url":"https://api.github.com/users/alainfrisch/gists{/gist_id}","starred_url":"https://api.github.com/users/alainfrisch/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/alainfrisch/subscriptions","organizations_url":"https://api.github.com/users/alainfrisch/orgs","repos_url":"https://api.github.com/users/alainfrisch/repos","events_url":"https://api.github.com/users/alainfrisch/events{/privacy}","received_events_url":"https://api.github.com/users/alainfrisch/received_events","type":"User","site_admin":false},"body":"Some very quick testing suggests that we go from about 550 Mb/s for the current version to 715 Mb/s with the version above.","created_at":"2018-02-27T10:46:51Z","updated_at":"2018-02-27T10:46:51Z","html_url":"https://github.com/ocaml/ocaml/pull/1637#discussion_r170882164","pull_request_url":"https://api.github.com/repos/ocaml/ocaml/pulls/1637","author_association":"CONTRIBUTOR","_links":{"self":{"href":"https://api.github.com/repos/ocaml/ocaml/pulls/comments/170882164"},"html":{"href":"https://github.com/ocaml/ocaml/pull/1637#discussion_r170882164"},"pull_request":{"href":"https://api.github.com/repos/ocaml/ocaml/pulls/1637"}},"in_reply_to_id":170876106},"pull_request":{"url":"https://api.github.com/repos/ocaml/ocaml/pulls/1637","id":171618683,"html_url":"https://github.com/ocaml/ocaml/pull/1637","diff_url":"https://github.com/ocaml/ocaml/pull/1637.diff","patch_url":"https://github.com/ocaml/ocaml/pull/1637.patch","issue_url":"https://api.github.com/repos/ocaml/ocaml/issues/1637","number":1637,"state":"open","locked":false,"title":"Optimize String.escaped","user":{"login":"nojb","id":113560,"avatar_url":"https://avatars3.githubusercontent.com/u/113560?v=4","gravatar_id":"","url":"https://api.github.com/users/nojb","html_url":"https://github.com/nojb","followers_url":"https://api.github.com/users/nojb/followers","following_url":"https://api.github.com/users/nojb/following{/other_user}","gists_url":"https://api.github.com/users/nojb/gists{/gist_id}","starred_url":"https://api.github.com/users/nojb/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nojb/subscriptions","organizations_url":"https://api.github.com/users/nojb/orgs","repos_url":"https://api.github.com/users/nojb/repos","events_url":"https://api.github.com/users/nojb/events{/privacy}","received_events_url":"https://api.github.com/users/nojb/received_events","type":"User","site_admin":false},"body":"A small optimization, avoiding some allocation in the fast path.\r\n\r\nThe patch is due to @alainfrisch, I just packaged it as a PR.\r\n\r\nDo we need a Changes entry?","created_at":"2018-02-27T10:21:25Z","updated_at":"2018-02-27T10:46:51Z","closed_at":null,"merged_at":null,"merge_commit_sha":"34ec973f3693639c1c4d4d2a25cba52d8ad6a812","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/ocaml/ocaml/pulls/1637/commits","review_comments_url":"https://api.github.com/repos/ocaml/ocaml/pulls/1637/comments","review_comment_url":"https://api.github.com/repos/ocaml/ocaml/pulls/comments{/number}","comments_url":"https://api.github.com/repos/ocaml/ocaml/issues/1637/comments","statuses_url":"https://api.github.com/repos/ocaml/ocaml/statuses/d25eaa6f15efb32ec6b142b8d92cd3a01981413e","head":{"label":"nojb:string_escape_optim","ref":"string_escape_optim","sha":"d25eaa6f15efb32ec6b142b8d92cd3a01981413e","user":{"login":"nojb","id":113560,"avatar_url":"https://avatars3.githubusercontent.com/u/113560?v=4","gravatar_id":"","url":"https://api.github.com/users/nojb","html_url":"https://github.com/nojb","followers_url":"https://api.github.com/users/nojb/followers","following_url":"https://api.github.com/users/nojb/following{/other_user}","gists_url":"https://api.github.com/users/nojb/gists{/gist_id}","starred_url":"https://api.github.com/users/nojb/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nojb/subscriptions","organizations_url":"https://api.github.com/users/nojb/orgs","repos_url":"https://api.github.com/users/nojb/repos","events_url":"https://api.github.com/users/nojb/events{/privacy}","received_events_url":"https://api.github.com/users/nojb/received_events","type":"User","site_admin":false},"repo":{"id":20289314,"name":"ocaml","full_name":"nojb/ocaml","owner":{"login":"nojb","id":113560,"avatar_url":"https://avatars3.githubusercontent.com/u/113560?v=4","gravatar_id":"","url":"https://api.github.com/users/nojb","html_url":"https://github.com/nojb","followers_url":"https://api.github.com/users/nojb/followers","following_url":"https://api.github.com/users/nojb/following{/other_user}","gists_url":"https://api.github.com/users/nojb/gists{/gist_id}","starred_url":"https://api.github.com/users/nojb/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nojb/subscriptions","organizations_url":"https://api.github.com/users/nojb/orgs","repos_url":"https://api.github.com/users/nojb/repos","events_url":"https://api.github.com/users/nojb/events{/privacy}","received_events_url":"https://api.github.com/users/nojb/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/nojb/ocaml","description":"Read-only mirror of INRIA SVN","fork":true,"url":"https://api.github.com/repos/nojb/ocaml","forks_url":"https://api.github.com/repos/nojb/ocaml/forks","keys_url":"https://api.github.com/repos/nojb/ocaml/keys{/key_id}","collaborators_url":"https://api.github.com/repos/nojb/ocaml/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/nojb/ocaml/teams","hooks_url":"https://api.github.com/repos/nojb/ocaml/hooks","issue_events_url":"https://api.github.com/repos/nojb/ocaml/issues/events{/number}","events_url":"https://api.github.com/repos/nojb/ocaml/events","assignees_url":"https://api.github.com/repos/nojb/ocaml/assignees{/user}","branches_url":"https://api.github.com/repos/nojb/ocaml/branches{/branch}","tags_url":"https://api.github.com/repos/nojb/ocaml/tags","blobs_url":"https://api.github.com/repos/nojb/ocaml/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/nojb/ocaml/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/nojb/ocaml/git/refs{/sha}","trees_url":"https://api.github.com/repos/nojb/ocaml/git/trees{/sha}","statuses_url":"https://api.github.com/repos/nojb/ocaml/statuses/{sha}","languages_url":"https://api.github.com/repos/nojb/ocaml/languages","stargazers_url":"https://api.github.com/repos/nojb/ocaml/stargazers","contributors_url":"https://api.github.com/repos/nojb/ocaml/contributors","subscribers_url":"https://api.github.com/repos/nojb/ocaml/subscribers","subscription_url":"https://api.github.com/repos/nojb/ocaml/subscription","commits_url":"https://api.github.com/repos/nojb/ocaml/commits{/sha}","git_commits_url":"https://api.github.com/repos/nojb/ocaml/git/commits{/sha}","comments_url":"https://api.github.com/repos/nojb/ocaml/comments{/number}","issue_comment_url":"https://api.github.com/repos/nojb/ocaml/issues/comments{/number}","contents_url":"https://api.github.com/repos/nojb/ocaml/contents/{+path}","compare_url":"https://api.github.com/repos/nojb/ocaml/compare/{base}...{head}","merges_url":"https://api.github.com/repos/nojb/ocaml/merges","archive_url":"https://api.github.com/repos/nojb/ocaml/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/nojb/ocaml/downloads","issues_url":"https://api.github.com/repos/nojb/ocaml/issues{/number}","pulls_url":"https://api.github.com/repos/nojb/ocaml/pulls{/number}","milestones_url":"https://api.github.com/repos/nojb/ocaml/milestones{/number}","notifications_url":"https://api.github.com/repos/nojb/ocaml/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/nojb/ocaml/labels{/name}","releases_url":"https://api.github.com/repos/nojb/ocaml/releases{/id}","deployments_url":"https://api.github.com/repos/nojb/ocaml/deployments","created_at":"2014-05-29T09:45:11Z","updated_at":"2016-12-04T12:56:28Z","pushed_at":"2018-02-27T08:49:29Z","git_url":"git://github.com/nojb/ocaml.git","ssh_url":"git@github.com:nojb/ocaml.git","clone_url":"https://github.com/nojb/ocaml.git","svn_url":"https://github.com/nojb/ocaml","homepage":null,"size":168306,"stargazers_count":1,"watchers_count":1,"language":"OCaml","has_issues":false,"has_projects":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"open_issues_count":1,"license":{"key":"lgpl-2.1","name":"GNU Lesser General Public License v2.1","spdx_id":"LGPL-2.1","url":"https://api.github.com/licenses/lgpl-2.1"},"forks":0,"open_issues":1,"watchers":1,"default_branch":"trunk"}},"base":{"label":"ocaml:trunk","ref":"trunk","sha":"9cb685557dc0c653e77dea9e41be1222b5cb363b","user":{"login":"ocaml","id":1841483,"avatar_url":"https://avatars3.githubusercontent.com/u/1841483?v=4","gravatar_id":"","url":"https://api.github.com/users/ocaml","html_url":"https://github.com/ocaml","followers_url":"https://api.github.com/users/ocaml/followers","following_url":"https://api.github.com/users/ocaml/following{/other_user}","gists_url":"https://api.github.com/users/ocaml/gists{/gist_id}","starred_url":"https://api.github.com/users/ocaml/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ocaml/subscriptions","organizations_url":"https://api.github.com/users/ocaml/orgs","repos_url":"https://api.github.com/users/ocaml/repos","events_url":"https://api.github.com/users/ocaml/events{/privacy}","received_events_url":"https://api.github.com/users/ocaml/received_events","type":"Organization","site_admin":false},"repo":{"id":6786166,"name":"ocaml","full_name":"ocaml/ocaml","owner":{"login":"ocaml","id":1841483,"avatar_url":"https://avatars3.githubusercontent.com/u/1841483?v=4","gravatar_id":"","url":"https://api.github.com/users/ocaml","html_url":"https://github.com/ocaml","followers_url":"https://api.github.com/users/ocaml/followers","following_url":"https://api.github.com/users/ocaml/following{/other_user}","gists_url":"https://api.github.com/users/ocaml/gists{/gist_id}","starred_url":"https://api.github.com/users/ocaml/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ocaml/subscriptions","organizations_url":"https://api.github.com/users/ocaml/orgs","repos_url":"https://api.github.com/users/ocaml/repos","events_url":"https://api.github.com/users/ocaml/events{/privacy}","received_events_url":"https://api.github.com/users/ocaml/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/ocaml/ocaml","description":"The core OCaml system: compilers, runtime system, base libraries","fork":false,"url":"https://api.github.com/repos/ocaml/ocaml","forks_url":"https://api.github.com/repos/ocaml/ocaml/forks","keys_url":"https://api.github.com/repos/ocaml/ocaml/keys{/key_id}","collaborators_url":"https://api.github.com/repos/ocaml/ocaml/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/ocaml/ocaml/teams","hooks_url":"https://api.github.com/repos/ocaml/ocaml/hooks","issue_events_url":"https://api.github.com/repos/ocaml/ocaml/issues/events{/number}","events_url":"https://api.github.com/repos/ocaml/ocaml/events","assignees_url":"https://api.github.com/repos/ocaml/ocaml/assignees{/user}","branches_url":"https://api.github.com/repos/ocaml/ocaml/branches{/branch}","tags_url":"https://api.github.com/repos/ocaml/ocaml/tags","blobs_url":"https://api.github.com/repos/ocaml/ocaml/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/ocaml/ocaml/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/ocaml/ocaml/git/refs{/sha}","trees_url":"https://api.github.com/repos/ocaml/ocaml/git/trees{/sha}","statuses_url":"https://api.github.com/repos/ocaml/ocaml/statuses/{sha}","languages_url":"https://api.github.com/repos/ocaml/ocaml/languages","stargazers_url":"https://api.github.com/repos/ocaml/ocaml/stargazers","contributors_url":"https://api.github.com/repos/ocaml/ocaml/contributors","subscribers_url":"https://api.github.com/repos/ocaml/ocaml/subscribers","subscription_url":"https://api.github.com/repos/ocaml/ocaml/subscription","commits_url":"https://api.github.com/repos/ocaml/ocaml/commits{/sha}","git_commits_url":"https://api.github.com/repos/ocaml/ocaml/git/commits{/sha}","comments_url":"https://api.github.com/repos/ocaml/ocaml/comments{/number}","issue_comment_url":"https://api.github.com/repos/ocaml/ocaml/issues/comments{/number}","contents_url":"https://api.github.com/repos/ocaml/ocaml/contents/{+path}","compare_url":"https://api.github.com/repos/ocaml/ocaml/compare/{base}...{head}","merges_url":"https://api.github.com/repos/ocaml/ocaml/merges","archive_url":"https://api.github.com/repos/ocaml/ocaml/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/ocaml/ocaml/downloads","issues_url":"https://api.github.com/repos/ocaml/ocaml/issues{/number}","pulls_url":"https://api.github.com/repos/ocaml/ocaml/pulls{/number}","milestones_url":"https://api.github.com/repos/ocaml/ocaml/milestones{/number}","notifications_url":"https://api.github.com/repos/ocaml/ocaml/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/ocaml/ocaml/labels{/name}","releases_url":"https://api.github.com/repos/ocaml/ocaml/releases{/id}","deployments_url":"https://api.github.com/repos/ocaml/ocaml/deployments","created_at":"2012-11-20T22:18:22Z","updated_at":"2018-02-27T05:27:00Z","pushed_at":"2018-02-27T10:21:26Z","git_url":"git://github.com/ocaml/ocaml.git","ssh_url":"git@github.com:ocaml/ocaml.git","clone_url":"https://github.com/ocaml/ocaml.git","svn_url":"https://github.com/ocaml/ocaml","homepage":"","size":160052,"stargazers_count":1713,"watchers_count":1713,"language":"OCaml","has_issues":false,"has_projects":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":440,"mirror_url":null,"archived":false,"open_issues_count":167,"license":{"key":"other","name":"Other","spdx_id":null,"url":null},"forks":440,"open_issues":167,"watchers":1713,"default_branch":"trunk"}},"_links":{"self":{"href":"https://api.github.com/repos/ocaml/ocaml/pulls/1637"},"html":{"href":"https://github.com/ocaml/ocaml/pull/1637"},"issue":{"href":"https://api.github.com/repos/ocaml/ocaml/issues/1637"},"comments":{"href":"https://api.github.com/repos/ocaml/ocaml/issues/1637/comments"},"review_comments":{"href":"https://api.github.com/repos/ocaml/ocaml/pulls/1637/comments"},"review_comment":{"href":"https://api.github.com/repos/ocaml/ocaml/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/ocaml/ocaml/pulls/1637/commits"},"statuses":{"href":"https://api.github.com/repos/ocaml/ocaml/statuses/d25eaa6f15efb32ec6b142b8d92cd3a01981413e"}},"author_association":"CONTRIBUTOR"}}
{"actor":{"display_login":"alainfrisch"}}