{"action":"created","comment":{"url":"https://api.github.com/repos/skiplang/skip/pulls/comments/222491098","pull_request_review_id":161391345,"id":222491098,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDIyMjQ5MTA5OA==","diff_hunk":"@@ -35,8 +37,13 @@ native class .String uses Hashable, Show, Orderable {\n         throwOutOfBounds()\n       };\n \n-      v = Array::fillBy(len, i -> this.unsafe_get(start + i));\n-      static::fromChars(v)\n+      // We don't want to use unsafe_get because it is O(n)\n+      subString = mutable Vector[];\n+      iter = this.getIter().drop(start);\n+      for (_ in Range(0, len)) {\n+        subString.push(iter.next().fromSome())\n+      };\n+      static::fromChars(freeze(subString.toArray()))","path":"tests/runtime/prelude/core/primitives/String.sk","position":21,"original_position":21,"commit_id":"06c941e10d13983219a16f89e9de6a6a8a03f2be","original_commit_id":"06c941e10d13983219a16f89e9de6a6a8a03f2be","user":{"login":"vjeux","id":197597,"node_id":"MDQ6VXNlcjE5NzU5Nw==","avatar_url":"https://avatars0.githubusercontent.com/u/197597?v=4","gravatar_id":"","url":"https://api.github.com/users/vjeux","html_url":"https://github.com/vjeux","followers_url":"https://api.github.com/users/vjeux/followers","following_url":"https://api.github.com/users/vjeux/following{/other_user}","gists_url":"https://api.github.com/users/vjeux/gists{/gist_id}","starred_url":"https://api.github.com/users/vjeux/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/vjeux/subscriptions","organizations_url":"https://api.github.com/users/vjeux/orgs","repos_url":"https://api.github.com/users/vjeux/repos","events_url":"https://api.github.com/users/vjeux/events{/privacy}","received_events_url":"https://api.github.com/users/vjeux/received_events","type":"User","site_admin":false},"body":"You can use `StringIterator.substring(endIterator)`\r\nhttps://github.com/skiplang/skip/blob/master/src/runtime/prelude/native/StringIterator.sk#L55\r\n\r\n```js\r\niter = this.getIter().drop(start);\r\niter.substring(iter.clone().drop(end - start));\r\n```\r\n","created_at":"2018-10-03T22:44:24Z","updated_at":"2018-10-03T22:44:24Z","html_url":"https://github.com/skiplang/skip/pull/54#discussion_r222491098","pull_request_url":"https://api.github.com/repos/skiplang/skip/pulls/54","author_association":"CONTRIBUTOR","_links":{"self":{"href":"https://api.github.com/repos/skiplang/skip/pulls/comments/222491098"},"html":{"href":"https://github.com/skiplang/skip/pull/54#discussion_r222491098"},"pull_request":{"href":"https://api.github.com/repos/skiplang/skip/pulls/54"}}},"pull_request":{"url":"https://api.github.com/repos/skiplang/skip/pulls/54","id":220190255,"node_id":"MDExOlB1bGxSZXF1ZXN0MjIwMTkwMjU1","html_url":"https://github.com/skiplang/skip/pull/54","diff_url":"https://github.com/skiplang/skip/pull/54.diff","patch_url":"https://github.com/skiplang/skip/pull/54.patch","issue_url":"https://api.github.com/repos/skiplang/skip/issues/54","number":54,"state":"open","locked":false,"title":"Speedup of the  string literal lexer","user":{"login":"pikatchu","id":235350,"node_id":"MDQ6VXNlcjIzNTM1MA==","avatar_url":"https://avatars1.githubusercontent.com/u/235350?v=4","gravatar_id":"","url":"https://api.github.com/users/pikatchu","html_url":"https://github.com/pikatchu","followers_url":"https://api.github.com/users/pikatchu/followers","following_url":"https://api.github.com/users/pikatchu/following{/other_user}","gists_url":"https://api.github.com/users/pikatchu/gists{/gist_id}","starred_url":"https://api.github.com/users/pikatchu/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pikatchu/subscriptions","organizations_url":"https://api.github.com/users/pikatchu/orgs","repos_url":"https://api.github.com/users/pikatchu/repos","events_url":"https://api.github.com/users/pikatchu/events{/privacy}","received_events_url":"https://api.github.com/users/pikatchu/received_events","type":"User","site_admin":false},"body":"Loading a file with large strings was taking a long time because\r\nthe implementation of substring was not very efficient (it was\r\nusing unsafe_get, which is O(n) on utf8 strings).\r\n\r\nAlso, the special character decoding made many calls to substring,\r\nwhich is O(n) (again because of ut8).","created_at":"2018-10-03T21:46:39Z","updated_at":"2018-10-03T22:44:24Z","closed_at":null,"merged_at":null,"merge_commit_sha":"eff4326277b2a2d1d13b6903c8d1ecc2cc05c1ac","assignee":null,"assignees":[],"requested_reviewers":[{"login":"jasone","id":245970,"node_id":"MDQ6VXNlcjI0NTk3MA==","avatar_url":"https://avatars1.githubusercontent.com/u/245970?v=4","gravatar_id":"","url":"https://api.github.com/users/jasone","html_url":"https://github.com/jasone","followers_url":"https://api.github.com/users/jasone/followers","following_url":"https://api.github.com/users/jasone/following{/other_user}","gists_url":"https://api.github.com/users/jasone/gists{/gist_id}","starred_url":"https://api.github.com/users/jasone/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jasone/subscriptions","organizations_url":"https://api.github.com/users/jasone/orgs","repos_url":"https://api.github.com/users/jasone/repos","events_url":"https://api.github.com/users/jasone/events{/privacy}","received_events_url":"https://api.github.com/users/jasone/received_events","type":"User","site_admin":false}],"requested_teams":[],"labels":[{"id":1034523779,"node_id":"MDU6TGFiZWwxMDM0NTIzNzc5","url":"https://api.github.com/repos/skiplang/skip/labels/CLA%20Signed","name":"CLA Signed","color":"009900","default":false}],"milestone":null,"commits_url":"https://api.github.com/repos/skiplang/skip/pulls/54/commits","review_comments_url":"https://api.github.com/repos/skiplang/skip/pulls/54/comments","review_comment_url":"https://api.github.com/repos/skiplang/skip/pulls/comments{/number}","comments_url":"https://api.github.com/repos/skiplang/skip/issues/54/comments","statuses_url":"https://api.github.com/repos/skiplang/skip/statuses/06c941e10d13983219a16f89e9de6a6a8a03f2be","head":{"label":"pikatchu:faster_string","ref":"faster_string","sha":"06c941e10d13983219a16f89e9de6a6a8a03f2be","user":{"login":"pikatchu","id":235350,"node_id":"MDQ6VXNlcjIzNTM1MA==","avatar_url":"https://avatars1.githubusercontent.com/u/235350?v=4","gravatar_id":"","url":"https://api.github.com/users/pikatchu","html_url":"https://github.com/pikatchu","followers_url":"https://api.github.com/users/pikatchu/followers","following_url":"https://api.github.com/users/pikatchu/following{/other_user}","gists_url":"https://api.github.com/users/pikatchu/gists{/gist_id}","starred_url":"https://api.github.com/users/pikatchu/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pikatchu/subscriptions","organizations_url":"https://api.github.com/users/pikatchu/orgs","repos_url":"https://api.github.com/users/pikatchu/repos","events_url":"https://api.github.com/users/pikatchu/events{/privacy}","received_events_url":"https://api.github.com/users/pikatchu/received_events","type":"User","site_admin":false},"repo":{"id":150770224,"node_id":"MDEwOlJlcG9zaXRvcnkxNTA3NzAyMjQ=","name":"skip","full_name":"pikatchu/skip","private":false,"owner":{"login":"pikatchu","id":235350,"node_id":"MDQ6VXNlcjIzNTM1MA==","avatar_url":"https://avatars1.githubusercontent.com/u/235350?v=4","gravatar_id":"","url":"https://api.github.com/users/pikatchu","html_url":"https://github.com/pikatchu","followers_url":"https://api.github.com/users/pikatchu/followers","following_url":"https://api.github.com/users/pikatchu/following{/other_user}","gists_url":"https://api.github.com/users/pikatchu/gists{/gist_id}","starred_url":"https://api.github.com/users/pikatchu/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pikatchu/subscriptions","organizations_url":"https://api.github.com/users/pikatchu/orgs","repos_url":"https://api.github.com/users/pikatchu/repos","events_url":"https://api.github.com/users/pikatchu/events{/privacy}","received_events_url":"https://api.github.com/users/pikatchu/received_events","type":"User","site_admin":false},"html_url":"https://github.com/pikatchu/skip","description":"A programming language to skip the things you have already computed","fork":true,"url":"https://api.github.com/repos/pikatchu/skip","forks_url":"https://api.github.com/repos/pikatchu/skip/forks","keys_url":"https://api.github.com/repos/pikatchu/skip/keys{/key_id}","collaborators_url":"https://api.github.com/repos/pikatchu/skip/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/pikatchu/skip/teams","hooks_url":"https://api.github.com/repos/pikatchu/skip/hooks","issue_events_url":"https://api.github.com/repos/pikatchu/skip/issues/events{/number}","events_url":"https://api.github.com/repos/pikatchu/skip/events","assignees_url":"https://api.github.com/repos/pikatchu/skip/assignees{/user}","branches_url":"https://api.github.com/repos/pikatchu/skip/branches{/branch}","tags_url":"https://api.github.com/repos/pikatchu/skip/tags","blobs_url":"https://api.github.com/repos/pikatchu/skip/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/pikatchu/skip/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/pikatchu/skip/git/refs{/sha}","trees_url":"https://api.github.com/repos/pikatchu/skip/git/trees{/sha}","statuses_url":"https://api.github.com/repos/pikatchu/skip/statuses/{sha}","languages_url":"https://api.github.com/repos/pikatchu/skip/languages","stargazers_url":"https://api.github.com/repos/pikatchu/skip/stargazers","contributors_url":"https://api.github.com/repos/pikatchu/skip/contributors","subscribers_url":"https://api.github.com/repos/pikatchu/skip/subscribers","subscription_url":"https://api.github.com/repos/pikatchu/skip/subscription","commits_url":"https://api.github.com/repos/pikatchu/skip/commits{/sha}","git_commits_url":"https://api.github.com/repos/pikatchu/skip/git/commits{/sha}","comments_url":"https://api.github.com/repos/pikatchu/skip/comments{/number}","issue_comment_url":"https://api.github.com/repos/pikatchu/skip/issues/comments{/number}","contents_url":"https://api.github.com/repos/pikatchu/skip/contents/{+path}","compare_url":"https://api.github.com/repos/pikatchu/skip/compare/{base}...{head}","merges_url":"https://api.github.com/repos/pikatchu/skip/merges","archive_url":"https://api.github.com/repos/pikatchu/skip/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/pikatchu/skip/downloads","issues_url":"https://api.github.com/repos/pikatchu/skip/issues{/number}","pulls_url":"https://api.github.com/repos/pikatchu/skip/pulls{/number}","milestones_url":"https://api.github.com/repos/pikatchu/skip/milestones{/number}","notifications_url":"https://api.github.com/repos/pikatchu/skip/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/pikatchu/skip/labels{/name}","releases_url":"https://api.github.com/repos/pikatchu/skip/releases{/id}","deployments_url":"https://api.github.com/repos/pikatchu/skip/deployments","created_at":"2018-09-28T16:56:24Z","updated_at":"2018-10-01T17:02:40Z","pushed_at":"2018-10-03T21:46:15Z","git_url":"git://github.com/pikatchu/skip.git","ssh_url":"git@github.com:pikatchu/skip.git","clone_url":"https://github.com/pikatchu/skip.git","svn_url":"https://github.com/pikatchu/skip","homepage":"http://www.skiplang.com","size":25957,"stargazers_count":0,"watchers_count":0,"language":"JavaScript","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":0,"license":{"key":"mit","name":"MIT License","spdx_id":"MIT","url":"https://api.github.com/licenses/mit","node_id":"MDc6TGljZW5zZTEz"},"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"skiplang:master","ref":"master","sha":"9a486939eecd3dbd8dc5c1ac3c9d6eeb947d6b4a","user":{"login":"skiplang","id":16479980,"node_id":"MDEyOk9yZ2FuaXphdGlvbjE2NDc5OTgw","avatar_url":"https://avatars2.githubusercontent.com/u/16479980?v=4","gravatar_id":"","url":"https://api.github.com/users/skiplang","html_url":"https://github.com/skiplang","followers_url":"https://api.github.com/users/skiplang/followers","following_url":"https://api.github.com/users/skiplang/following{/other_user}","gists_url":"https://api.github.com/users/skiplang/gists{/gist_id}","starred_url":"https://api.github.com/users/skiplang/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/skiplang/subscriptions","organizations_url":"https://api.github.com/users/skiplang/orgs","repos_url":"https://api.github.com/users/skiplang/repos","events_url":"https://api.github.com/users/skiplang/events{/privacy}","received_events_url":"https://api.github.com/users/skiplang/received_events","type":"Organization","site_admin":false},"repo":{"id":146020034,"node_id":"MDEwOlJlcG9zaXRvcnkxNDYwMjAwMzQ=","name":"skip","full_name":"skiplang/skip","private":false,"owner":{"login":"skiplang","id":16479980,"node_id":"MDEyOk9yZ2FuaXphdGlvbjE2NDc5OTgw","avatar_url":"https://avatars2.githubusercontent.com/u/16479980?v=4","gravatar_id":"","url":"https://api.github.com/users/skiplang","html_url":"https://github.com/skiplang","followers_url":"https://api.github.com/users/skiplang/followers","following_url":"https://api.github.com/users/skiplang/following{/other_user}","gists_url":"https://api.github.com/users/skiplang/gists{/gist_id}","starred_url":"https://api.github.com/users/skiplang/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/skiplang/subscriptions","organizations_url":"https://api.github.com/users/skiplang/orgs","repos_url":"https://api.github.com/users/skiplang/repos","events_url":"https://api.github.com/users/skiplang/events{/privacy}","received_events_url":"https://api.github.com/users/skiplang/received_events","type":"Organization","site_admin":false},"html_url":"https://github.com/skiplang/skip","description":"A programming language to skip the things you have already computed","fork":false,"url":"https://api.github.com/repos/skiplang/skip","forks_url":"https://api.github.com/repos/skiplang/skip/forks","keys_url":"https://api.github.com/repos/skiplang/skip/keys{/key_id}","collaborators_url":"https://api.github.com/repos/skiplang/skip/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/skiplang/skip/teams","hooks_url":"https://api.github.com/repos/skiplang/skip/hooks","issue_events_url":"https://api.github.com/repos/skiplang/skip/issues/events{/number}","events_url":"https://api.github.com/repos/skiplang/skip/events","assignees_url":"https://api.github.com/repos/skiplang/skip/assignees{/user}","branches_url":"https://api.github.com/repos/skiplang/skip/branches{/branch}","tags_url":"https://api.github.com/repos/skiplang/skip/tags","blobs_url":"https://api.github.com/repos/skiplang/skip/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/skiplang/skip/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/skiplang/skip/git/refs{/sha}","trees_url":"https://api.github.com/repos/skiplang/skip/git/trees{/sha}","statuses_url":"https://api.github.com/repos/skiplang/skip/statuses/{sha}","languages_url":"https://api.github.com/repos/skiplang/skip/languages","stargazers_url":"https://api.github.com/repos/skiplang/skip/stargazers","contributors_url":"https://api.github.com/repos/skiplang/skip/contributors","subscribers_url":"https://api.github.com/repos/skiplang/skip/subscribers","subscription_url":"https://api.github.com/repos/skiplang/skip/subscription","commits_url":"https://api.github.com/repos/skiplang/skip/commits{/sha}","git_commits_url":"https://api.github.com/repos/skiplang/skip/git/commits{/sha}","comments_url":"https://api.github.com/repos/skiplang/skip/comments{/number}","issue_comment_url":"https://api.github.com/repos/skiplang/skip/issues/comments{/number}","contents_url":"https://api.github.com/repos/skiplang/skip/contents/{+path}","compare_url":"https://api.github.com/repos/skiplang/skip/compare/{base}...{head}","merges_url":"https://api.github.com/repos/skiplang/skip/merges","archive_url":"https://api.github.com/repos/skiplang/skip/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/skiplang/skip/downloads","issues_url":"https://api.github.com/repos/skiplang/skip/issues{/number}","pulls_url":"https://api.github.com/repos/skiplang/skip/pulls{/number}","milestones_url":"https://api.github.com/repos/skiplang/skip/milestones{/number}","notifications_url":"https://api.github.com/repos/skiplang/skip/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/skiplang/skip/labels{/name}","releases_url":"https://api.github.com/repos/skiplang/skip/releases{/id}","deployments_url":"https://api.github.com/repos/skiplang/skip/deployments","created_at":"2018-08-24T17:18:41Z","updated_at":"2018-10-03T21:06:26Z","pushed_at":"2018-10-03T21:46:40Z","git_url":"git://github.com/skiplang/skip.git","ssh_url":"git@github.com:skiplang/skip.git","clone_url":"https://github.com/skiplang/skip.git","svn_url":"https://github.com/skiplang/skip","homepage":"http://www.skiplang.com","size":25968,"stargazers_count":1224,"watchers_count":1224,"language":"JavaScript","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":40,"mirror_url":null,"archived":false,"open_issues_count":21,"license":{"key":"mit","name":"MIT License","spdx_id":"MIT","url":"https://api.github.com/licenses/mit","node_id":"MDc6TGljZW5zZTEz"},"forks":40,"open_issues":21,"watchers":1224,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/skiplang/skip/pulls/54"},"html":{"href":"https://github.com/skiplang/skip/pull/54"},"issue":{"href":"https://api.github.com/repos/skiplang/skip/issues/54"},"comments":{"href":"https://api.github.com/repos/skiplang/skip/issues/54/comments"},"review_comments":{"href":"https://api.github.com/repos/skiplang/skip/pulls/54/comments"},"review_comment":{"href":"https://api.github.com/repos/skiplang/skip/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/skiplang/skip/pulls/54/commits"},"statuses":{"href":"https://api.github.com/repos/skiplang/skip/statuses/06c941e10d13983219a16f89e9de6a6a8a03f2be"}},"author_association":"CONTRIBUTOR"}}
{"actor":{"display_login":"vjeux"}}