{"action":"created","comment":{"url":"https://api.github.com/repos/mozilla/pdf.js/pulls/comments/60074092","id":60074092,"diff_hunk":"@@ -267,24 +242,483 @@ var ChunkedStream = (function ChunkedStreamClosure() {\n         return missingChunks;\n       };\n       var subStream = new ChunkedStreamSubstream();\n+      subStream.ensureRange(start, start + length);\n       subStream.pos = subStream.start = start;\n       subStream.end = start + length || this.end;\n       subStream.dict = dict;\n+      subStream.totalLength = subStream.end - subStream.start;\n+      subStream.subStream = true;\n+\n+      if (subStream.start >= subStream.buffer.start &&\n+          subStream.end <= subStream.buffer.end) {\n+        // Stream is fully loaded, use fast getByteMethod\n+        subStream.getByte = this.continuousAlloc ?\n+          this.getByteFastContinuous(subStream.buffer.buffer, subStream.end) :","path":"src/core/chunked_stream.js","position":307,"original_position":307,"commit_id":"734fe3631bc4b4395e5a945a0cd17eaa1ff088d9","original_commit_id":"734fe3631bc4b4395e5a945a0cd17eaa1ff088d9","user":{"login":"yurydelendik","id":1523410,"avatar_url":"https://avatars.githubusercontent.com/u/1523410?v=3","gravatar_id":"","url":"https://api.github.com/users/yurydelendik","html_url":"https://github.com/yurydelendik","followers_url":"https://api.github.com/users/yurydelendik/followers","following_url":"https://api.github.com/users/yurydelendik/following{/other_user}","gists_url":"https://api.github.com/users/yurydelendik/gists{/gist_id}","starred_url":"https://api.github.com/users/yurydelendik/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/yurydelendik/subscriptions","organizations_url":"https://api.github.com/users/yurydelendik/orgs","repos_url":"https://api.github.com/users/yurydelendik/repos","events_url":"https://api.github.com/users/yurydelendik/events{/privacy}","received_events_url":"https://api.github.com/users/yurydelendik/received_events","type":"User","site_admin":false},"body":"create a method with e.g. `createGetByteFast` and implement is differently on the subclasses ","created_at":"2016-04-18T15:00:30Z","updated_at":"2016-04-18T15:00:30Z","html_url":"https://github.com/mozilla/pdf.js/pull/5332#discussion_r60074092","pull_request_url":"https://api.github.com/repos/mozilla/pdf.js/pulls/5332","_links":{"self":{"href":"https://api.github.com/repos/mozilla/pdf.js/pulls/comments/60074092"},"html":{"href":"https://github.com/mozilla/pdf.js/pull/5332#discussion_r60074092"},"pull_request":{"href":"https://api.github.com/repos/mozilla/pdf.js/pulls/5332"}}},"pull_request":{"url":"https://api.github.com/repos/mozilla/pdf.js/pulls/5332","id":21649893,"html_url":"https://github.com/mozilla/pdf.js/pull/5332","diff_url":"https://github.com/mozilla/pdf.js/pull/5332.diff","patch_url":"https://github.com/mozilla/pdf.js/pull/5332.patch","issue_url":"https://api.github.com/repos/mozilla/pdf.js/issues/5332","number":5332,"state":"open","locked":false,"title":"Improving memory usage for PDF files loaded by chunks","user":{"login":"bh213","id":277492,"avatar_url":"https://avatars.githubusercontent.com/u/277492?v=3","gravatar_id":"","url":"https://api.github.com/users/bh213","html_url":"https://github.com/bh213","followers_url":"https://api.github.com/users/bh213/followers","following_url":"https://api.github.com/users/bh213/following{/other_user}","gists_url":"https://api.github.com/users/bh213/gists{/gist_id}","starred_url":"https://api.github.com/users/bh213/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bh213/subscriptions","organizations_url":"https://api.github.com/users/bh213/orgs","repos_url":"https://api.github.com/users/bh213/repos","events_url":"https://api.github.com/users/bh213/events{/privacy}","received_events_url":"https://api.github.com/users/bh213/received_events","type":"User","site_admin":false},"body":"as described in #5329, this significantly reduces memory usage for large files loaded by chunking","created_at":"2014-09-23T14:40:01Z","updated_at":"2016-04-18T15:00:30Z","closed_at":null,"merged_at":null,"merge_commit_sha":"32c0e5e4d3ebd47363b174a96f8c3556def01fb9","assignee":{"login":"yurydelendik","id":1523410,"avatar_url":"https://avatars.githubusercontent.com/u/1523410?v=3","gravatar_id":"","url":"https://api.github.com/users/yurydelendik","html_url":"https://github.com/yurydelendik","followers_url":"https://api.github.com/users/yurydelendik/followers","following_url":"https://api.github.com/users/yurydelendik/following{/other_user}","gists_url":"https://api.github.com/users/yurydelendik/gists{/gist_id}","starred_url":"https://api.github.com/users/yurydelendik/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/yurydelendik/subscriptions","organizations_url":"https://api.github.com/users/yurydelendik/orgs","repos_url":"https://api.github.com/users/yurydelendik/repos","events_url":"https://api.github.com/users/yurydelendik/events{/privacy}","received_events_url":"https://api.github.com/users/yurydelendik/received_events","type":"User","site_admin":false},"milestone":null,"commits_url":"https://api.github.com/repos/mozilla/pdf.js/pulls/5332/commits","review_comments_url":"https://api.github.com/repos/mozilla/pdf.js/pulls/5332/comments","review_comment_url":"https://api.github.com/repos/mozilla/pdf.js/pulls/comments{/number}","comments_url":"https://api.github.com/repos/mozilla/pdf.js/issues/5332/comments","statuses_url":"https://api.github.com/repos/mozilla/pdf.js/statuses/734fe3631bc4b4395e5a945a0cd17eaa1ff088d9","head":{"label":"bh213:chunkedstream_with_chunked_memory","ref":"chunkedstream_with_chunked_memory","sha":"734fe3631bc4b4395e5a945a0cd17eaa1ff088d9","user":{"login":"bh213","id":277492,"avatar_url":"https://avatars.githubusercontent.com/u/277492?v=3","gravatar_id":"","url":"https://api.github.com/users/bh213","html_url":"https://github.com/bh213","followers_url":"https://api.github.com/users/bh213/followers","following_url":"https://api.github.com/users/bh213/following{/other_user}","gists_url":"https://api.github.com/users/bh213/gists{/gist_id}","starred_url":"https://api.github.com/users/bh213/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bh213/subscriptions","organizations_url":"https://api.github.com/users/bh213/orgs","repos_url":"https://api.github.com/users/bh213/repos","events_url":"https://api.github.com/users/bh213/events{/privacy}","received_events_url":"https://api.github.com/users/bh213/received_events","type":"User","site_admin":false},"repo":{"id":24227490,"name":"pdf.js","full_name":"bh213/pdf.js","owner":{"login":"bh213","id":277492,"avatar_url":"https://avatars.githubusercontent.com/u/277492?v=3","gravatar_id":"","url":"https://api.github.com/users/bh213","html_url":"https://github.com/bh213","followers_url":"https://api.github.com/users/bh213/followers","following_url":"https://api.github.com/users/bh213/following{/other_user}","gists_url":"https://api.github.com/users/bh213/gists{/gist_id}","starred_url":"https://api.github.com/users/bh213/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bh213/subscriptions","organizations_url":"https://api.github.com/users/bh213/orgs","repos_url":"https://api.github.com/users/bh213/repos","events_url":"https://api.github.com/users/bh213/events{/privacy}","received_events_url":"https://api.github.com/users/bh213/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/bh213/pdf.js","description":"PDF Reader in JavaScript","fork":true,"url":"https://api.github.com/repos/bh213/pdf.js","forks_url":"https://api.github.com/repos/bh213/pdf.js/forks","keys_url":"https://api.github.com/repos/bh213/pdf.js/keys{/key_id}","collaborators_url":"https://api.github.com/repos/bh213/pdf.js/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/bh213/pdf.js/teams","hooks_url":"https://api.github.com/repos/bh213/pdf.js/hooks","issue_events_url":"https://api.github.com/repos/bh213/pdf.js/issues/events{/number}","events_url":"https://api.github.com/repos/bh213/pdf.js/events","assignees_url":"https://api.github.com/repos/bh213/pdf.js/assignees{/user}","branches_url":"https://api.github.com/repos/bh213/pdf.js/branches{/branch}","tags_url":"https://api.github.com/repos/bh213/pdf.js/tags","blobs_url":"https://api.github.com/repos/bh213/pdf.js/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/bh213/pdf.js/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/bh213/pdf.js/git/refs{/sha}","trees_url":"https://api.github.com/repos/bh213/pdf.js/git/trees{/sha}","statuses_url":"https://api.github.com/repos/bh213/pdf.js/statuses/{sha}","languages_url":"https://api.github.com/repos/bh213/pdf.js/languages","stargazers_url":"https://api.github.com/repos/bh213/pdf.js/stargazers","contributors_url":"https://api.github.com/repos/bh213/pdf.js/contributors","subscribers_url":"https://api.github.com/repos/bh213/pdf.js/subscribers","subscription_url":"https://api.github.com/repos/bh213/pdf.js/subscription","commits_url":"https://api.github.com/repos/bh213/pdf.js/commits{/sha}","git_commits_url":"https://api.github.com/repos/bh213/pdf.js/git/commits{/sha}","comments_url":"https://api.github.com/repos/bh213/pdf.js/comments{/number}","issue_comment_url":"https://api.github.com/repos/bh213/pdf.js/issues/comments{/number}","contents_url":"https://api.github.com/repos/bh213/pdf.js/contents/{+path}","compare_url":"https://api.github.com/repos/bh213/pdf.js/compare/{base}...{head}","merges_url":"https://api.github.com/repos/bh213/pdf.js/merges","archive_url":"https://api.github.com/repos/bh213/pdf.js/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/bh213/pdf.js/downloads","issues_url":"https://api.github.com/repos/bh213/pdf.js/issues{/number}","pulls_url":"https://api.github.com/repos/bh213/pdf.js/pulls{/number}","milestones_url":"https://api.github.com/repos/bh213/pdf.js/milestones{/number}","notifications_url":"https://api.github.com/repos/bh213/pdf.js/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/bh213/pdf.js/labels{/name}","releases_url":"https://api.github.com/repos/bh213/pdf.js/releases{/id}","deployments_url":"https://api.github.com/repos/bh213/pdf.js/deployments","created_at":"2014-09-19T11:30:56Z","updated_at":"2015-03-18T11:29:53Z","pushed_at":"2016-04-15T11:16:16Z","git_url":"git://github.com/bh213/pdf.js.git","ssh_url":"git@github.com:bh213/pdf.js.git","clone_url":"https://github.com/bh213/pdf.js.git","svn_url":"https://github.com/bh213/pdf.js","homepage":"","size":59360,"stargazers_count":0,"watchers_count":0,"language":"JavaScript","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":"mozilla:master","ref":"master","sha":"e9dbb233aaacac77c6bdd7b9e8fedf0cf7de7eee","user":{"login":"mozilla","id":131524,"avatar_url":"https://avatars.githubusercontent.com/u/131524?v=3","gravatar_id":"","url":"https://api.github.com/users/mozilla","html_url":"https://github.com/mozilla","followers_url":"https://api.github.com/users/mozilla/followers","following_url":"https://api.github.com/users/mozilla/following{/other_user}","gists_url":"https://api.github.com/users/mozilla/gists{/gist_id}","starred_url":"https://api.github.com/users/mozilla/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mozilla/subscriptions","organizations_url":"https://api.github.com/users/mozilla/orgs","repos_url":"https://api.github.com/users/mozilla/repos","events_url":"https://api.github.com/users/mozilla/events{/privacy}","received_events_url":"https://api.github.com/users/mozilla/received_events","type":"Organization","site_admin":false},"repo":{"id":1663468,"name":"pdf.js","full_name":"mozilla/pdf.js","owner":{"login":"mozilla","id":131524,"avatar_url":"https://avatars.githubusercontent.com/u/131524?v=3","gravatar_id":"","url":"https://api.github.com/users/mozilla","html_url":"https://github.com/mozilla","followers_url":"https://api.github.com/users/mozilla/followers","following_url":"https://api.github.com/users/mozilla/following{/other_user}","gists_url":"https://api.github.com/users/mozilla/gists{/gist_id}","starred_url":"https://api.github.com/users/mozilla/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mozilla/subscriptions","organizations_url":"https://api.github.com/users/mozilla/orgs","repos_url":"https://api.github.com/users/mozilla/repos","events_url":"https://api.github.com/users/mozilla/events{/privacy}","received_events_url":"https://api.github.com/users/mozilla/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/mozilla/pdf.js","description":"PDF Reader in JavaScript","fork":false,"url":"https://api.github.com/repos/mozilla/pdf.js","forks_url":"https://api.github.com/repos/mozilla/pdf.js/forks","keys_url":"https://api.github.com/repos/mozilla/pdf.js/keys{/key_id}","collaborators_url":"https://api.github.com/repos/mozilla/pdf.js/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/mozilla/pdf.js/teams","hooks_url":"https://api.github.com/repos/mozilla/pdf.js/hooks","issue_events_url":"https://api.github.com/repos/mozilla/pdf.js/issues/events{/number}","events_url":"https://api.github.com/repos/mozilla/pdf.js/events","assignees_url":"https://api.github.com/repos/mozilla/pdf.js/assignees{/user}","branches_url":"https://api.github.com/repos/mozilla/pdf.js/branches{/branch}","tags_url":"https://api.github.com/repos/mozilla/pdf.js/tags","blobs_url":"https://api.github.com/repos/mozilla/pdf.js/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/mozilla/pdf.js/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/mozilla/pdf.js/git/refs{/sha}","trees_url":"https://api.github.com/repos/mozilla/pdf.js/git/trees{/sha}","statuses_url":"https://api.github.com/repos/mozilla/pdf.js/statuses/{sha}","languages_url":"https://api.github.com/repos/mozilla/pdf.js/languages","stargazers_url":"https://api.github.com/repos/mozilla/pdf.js/stargazers","contributors_url":"https://api.github.com/repos/mozilla/pdf.js/contributors","subscribers_url":"https://api.github.com/repos/mozilla/pdf.js/subscribers","subscription_url":"https://api.github.com/repos/mozilla/pdf.js/subscription","commits_url":"https://api.github.com/repos/mozilla/pdf.js/commits{/sha}","git_commits_url":"https://api.github.com/repos/mozilla/pdf.js/git/commits{/sha}","comments_url":"https://api.github.com/repos/mozilla/pdf.js/comments{/number}","issue_comment_url":"https://api.github.com/repos/mozilla/pdf.js/issues/comments{/number}","contents_url":"https://api.github.com/repos/mozilla/pdf.js/contents/{+path}","compare_url":"https://api.github.com/repos/mozilla/pdf.js/compare/{base}...{head}","merges_url":"https://api.github.com/repos/mozilla/pdf.js/merges","archive_url":"https://api.github.com/repos/mozilla/pdf.js/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/mozilla/pdf.js/downloads","issues_url":"https://api.github.com/repos/mozilla/pdf.js/issues{/number}","pulls_url":"https://api.github.com/repos/mozilla/pdf.js/pulls{/number}","milestones_url":"https://api.github.com/repos/mozilla/pdf.js/milestones{/number}","notifications_url":"https://api.github.com/repos/mozilla/pdf.js/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/mozilla/pdf.js/labels{/name}","releases_url":"https://api.github.com/repos/mozilla/pdf.js/releases{/id}","deployments_url":"https://api.github.com/repos/mozilla/pdf.js/deployments","created_at":"2011-04-26T06:32:03Z","updated_at":"2016-04-18T13:12:25Z","pushed_at":"2016-04-17T23:00:08Z","git_url":"git://github.com/mozilla/pdf.js.git","ssh_url":"git@github.com:mozilla/pdf.js.git","clone_url":"https://github.com/mozilla/pdf.js.git","svn_url":"https://github.com/mozilla/pdf.js","homepage":"","size":111455,"stargazers_count":14148,"watchers_count":14148,"language":"JavaScript","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":3346,"mirror_url":null,"open_issues_count":578,"forks":3346,"open_issues":578,"watchers":14148,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/mozilla/pdf.js/pulls/5332"},"html":{"href":"https://github.com/mozilla/pdf.js/pull/5332"},"issue":{"href":"https://api.github.com/repos/mozilla/pdf.js/issues/5332"},"comments":{"href":"https://api.github.com/repos/mozilla/pdf.js/issues/5332/comments"},"review_comments":{"href":"https://api.github.com/repos/mozilla/pdf.js/pulls/5332/comments"},"review_comment":{"href":"https://api.github.com/repos/mozilla/pdf.js/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/mozilla/pdf.js/pulls/5332/commits"},"statuses":{"href":"https://api.github.com/repos/mozilla/pdf.js/statuses/734fe3631bc4b4395e5a945a0cd17eaa1ff088d9"}}}}