{"action":"created","comment":{"url":"https://api.github.com/repos/tantivy-search/tantivy/pulls/comments/188942395","pull_request_review_id":121021309,"id":188942395,"diff_hunk":"@@ -62,6 +79,26 @@ impl DeleteBitSet {\n             b & (1u8 << shift) != 0\n         }\n     }\n+\n+    /// Returns the first non-empty `TinySet` associated to a bucket lower\n+    /// or greater than bucket.\n+    ///\n+    /// Reminder: the tiny set with the bucket `bucket`, represents the\n+    /// elements from `bucket * 64` to `(bucket+1) * 64`.\n+    pub(crate) fn first_non_empty_bucket(&self, bucket: u32) -> Option<u32> {\n+        self.tinysets[bucket as usize..]\n+            .iter()\n+            .cloned()\n+            .position(|tinyset| !tinyset.is_empty())\n+            .map(|delta_bucket| bucket + delta_bucket as u32)\n+    }\n+\n+    /// Returns the tiny bitset representing the\n+    /// the set restricted to the number range from\n+    /// `bucket * 64` to `(bucket + 1) * 64`.\n+    pub(crate) fn tinyset(&self, bucket: u32) -> TinySet {\n+        self.tinysets[bucket as usize]\n+    }\n }\n ","path":"src/fastfield/delete.rs","position":64,"original_position":64,"commit_id":"73933eadd74c58f027e37c6bfd6f312f7ecffca3","original_commit_id":"73933eadd74c58f027e37c6bfd6f312f7ecffca3","user":{"login":"fulmicoton","id":1021506,"avatar_url":"https://avatars0.githubusercontent.com/u/1021506?v=4","gravatar_id":"","url":"https://api.github.com/users/fulmicoton","html_url":"https://github.com/fulmicoton","followers_url":"https://api.github.com/users/fulmicoton/followers","following_url":"https://api.github.com/users/fulmicoton/following{/other_user}","gists_url":"https://api.github.com/users/fulmicoton/gists{/gist_id}","starred_url":"https://api.github.com/users/fulmicoton/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/fulmicoton/subscriptions","organizations_url":"https://api.github.com/users/fulmicoton/orgs","repos_url":"https://api.github.com/users/fulmicoton/repos","events_url":"https://api.github.com/users/fulmicoton/events{/privacy}","received_events_url":"https://api.github.com/users/fulmicoton/received_events","type":"User","site_admin":false},"body":"This needs a benchmark with different density to double check that this is effectively faster.","created_at":"2018-05-17T12:42:27Z","updated_at":"2018-05-17T12:42:28Z","html_url":"https://github.com/tantivy-search/tantivy/pull/304#discussion_r188942395","pull_request_url":"https://api.github.com/repos/tantivy-search/tantivy/pulls/304","author_association":"MEMBER","_links":{"self":{"href":"https://api.github.com/repos/tantivy-search/tantivy/pulls/comments/188942395"},"html":{"href":"https://github.com/tantivy-search/tantivy/pull/304#discussion_r188942395"},"pull_request":{"href":"https://api.github.com/repos/tantivy-search/tantivy/pulls/304"}}},"pull_request":{"url":"https://api.github.com/repos/tantivy-search/tantivy/pulls/304","id":188703036,"html_url":"https://github.com/tantivy-search/tantivy/pull/304","diff_url":"https://github.com/tantivy-search/tantivy/pull/304.diff","patch_url":"https://github.com/tantivy-search/tantivy/pull/304.patch","issue_url":"https://api.github.com/repos/tantivy-search/tantivy/issues/304","number":304,"state":"open","locked":false,"title":"Optimize segment readers alive doc iterator","user":{"login":"kphelps","id":4417434,"avatar_url":"https://avatars0.githubusercontent.com/u/4417434?v=4","gravatar_id":"","url":"https://api.github.com/users/kphelps","html_url":"https://github.com/kphelps","followers_url":"https://api.github.com/users/kphelps/followers","following_url":"https://api.github.com/users/kphelps/following{/other_user}","gists_url":"https://api.github.com/users/kphelps/gists{/gist_id}","starred_url":"https://api.github.com/users/kphelps/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kphelps/subscriptions","organizations_url":"https://api.github.com/users/kphelps/orgs","repos_url":"https://api.github.com/users/kphelps/repos","events_url":"https://api.github.com/users/kphelps/events{/privacy}","received_events_url":"https://api.github.com/users/kphelps/received_events","type":"User","site_admin":false},"body":"I took a stab at tackling https://github.com/tantivy-search/tantivy/issues/296. The `DeleteBitSet` now builds a slice of TinySets, then the `SegmentReaderAliveDocsIterator` leverages the tinysets to iterate through the alive documents more efficiently. As I'm not very familiar with the codebase, there may have been a cleaner way to do some parts of this - feedback is appreciated!\r\n\r\nCloses #296","created_at":"2018-05-17T11:16:38Z","updated_at":"2018-05-17T12:42:28Z","closed_at":null,"merged_at":null,"merge_commit_sha":"3859e2cab738a205eb20a4cea65ffb5053af1818","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/tantivy-search/tantivy/pulls/304/commits","review_comments_url":"https://api.github.com/repos/tantivy-search/tantivy/pulls/304/comments","review_comment_url":"https://api.github.com/repos/tantivy-search/tantivy/pulls/comments{/number}","comments_url":"https://api.github.com/repos/tantivy-search/tantivy/issues/304/comments","statuses_url":"https://api.github.com/repos/tantivy-search/tantivy/statuses/73933eadd74c58f027e37c6bfd6f312f7ecffca3","head":{"label":"kphelps:optmize-alive-iterator","ref":"optmize-alive-iterator","sha":"73933eadd74c58f027e37c6bfd6f312f7ecffca3","user":{"login":"kphelps","id":4417434,"avatar_url":"https://avatars0.githubusercontent.com/u/4417434?v=4","gravatar_id":"","url":"https://api.github.com/users/kphelps","html_url":"https://github.com/kphelps","followers_url":"https://api.github.com/users/kphelps/followers","following_url":"https://api.github.com/users/kphelps/following{/other_user}","gists_url":"https://api.github.com/users/kphelps/gists{/gist_id}","starred_url":"https://api.github.com/users/kphelps/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kphelps/subscriptions","organizations_url":"https://api.github.com/users/kphelps/orgs","repos_url":"https://api.github.com/users/kphelps/repos","events_url":"https://api.github.com/users/kphelps/events{/privacy}","received_events_url":"https://api.github.com/users/kphelps/received_events","type":"User","site_admin":false},"repo":{"id":133742834,"name":"tantivy","full_name":"kphelps/tantivy","owner":{"login":"kphelps","id":4417434,"avatar_url":"https://avatars0.githubusercontent.com/u/4417434?v=4","gravatar_id":"","url":"https://api.github.com/users/kphelps","html_url":"https://github.com/kphelps","followers_url":"https://api.github.com/users/kphelps/followers","following_url":"https://api.github.com/users/kphelps/following{/other_user}","gists_url":"https://api.github.com/users/kphelps/gists{/gist_id}","starred_url":"https://api.github.com/users/kphelps/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kphelps/subscriptions","organizations_url":"https://api.github.com/users/kphelps/orgs","repos_url":"https://api.github.com/users/kphelps/repos","events_url":"https://api.github.com/users/kphelps/events{/privacy}","received_events_url":"https://api.github.com/users/kphelps/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/kphelps/tantivy","description":"Tantivy is a full-text search engine library inspired by Lucene and written in Rust","fork":true,"url":"https://api.github.com/repos/kphelps/tantivy","forks_url":"https://api.github.com/repos/kphelps/tantivy/forks","keys_url":"https://api.github.com/repos/kphelps/tantivy/keys{/key_id}","collaborators_url":"https://api.github.com/repos/kphelps/tantivy/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/kphelps/tantivy/teams","hooks_url":"https://api.github.com/repos/kphelps/tantivy/hooks","issue_events_url":"https://api.github.com/repos/kphelps/tantivy/issues/events{/number}","events_url":"https://api.github.com/repos/kphelps/tantivy/events","assignees_url":"https://api.github.com/repos/kphelps/tantivy/assignees{/user}","branches_url":"https://api.github.com/repos/kphelps/tantivy/branches{/branch}","tags_url":"https://api.github.com/repos/kphelps/tantivy/tags","blobs_url":"https://api.github.com/repos/kphelps/tantivy/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/kphelps/tantivy/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/kphelps/tantivy/git/refs{/sha}","trees_url":"https://api.github.com/repos/kphelps/tantivy/git/trees{/sha}","statuses_url":"https://api.github.com/repos/kphelps/tantivy/statuses/{sha}","languages_url":"https://api.github.com/repos/kphelps/tantivy/languages","stargazers_url":"https://api.github.com/repos/kphelps/tantivy/stargazers","contributors_url":"https://api.github.com/repos/kphelps/tantivy/contributors","subscribers_url":"https://api.github.com/repos/kphelps/tantivy/subscribers","subscription_url":"https://api.github.com/repos/kphelps/tantivy/subscription","commits_url":"https://api.github.com/repos/kphelps/tantivy/commits{/sha}","git_commits_url":"https://api.github.com/repos/kphelps/tantivy/git/commits{/sha}","comments_url":"https://api.github.com/repos/kphelps/tantivy/comments{/number}","issue_comment_url":"https://api.github.com/repos/kphelps/tantivy/issues/comments{/number}","contents_url":"https://api.github.com/repos/kphelps/tantivy/contents/{+path}","compare_url":"https://api.github.com/repos/kphelps/tantivy/compare/{base}...{head}","merges_url":"https://api.github.com/repos/kphelps/tantivy/merges","archive_url":"https://api.github.com/repos/kphelps/tantivy/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/kphelps/tantivy/downloads","issues_url":"https://api.github.com/repos/kphelps/tantivy/issues{/number}","pulls_url":"https://api.github.com/repos/kphelps/tantivy/pulls{/number}","milestones_url":"https://api.github.com/repos/kphelps/tantivy/milestones{/number}","notifications_url":"https://api.github.com/repos/kphelps/tantivy/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/kphelps/tantivy/labels{/name}","releases_url":"https://api.github.com/repos/kphelps/tantivy/releases{/id}","deployments_url":"https://api.github.com/repos/kphelps/tantivy/deployments","created_at":"2018-05-17T01:36:37Z","updated_at":"2018-05-17T01:36:40Z","pushed_at":"2018-05-17T11:12:52Z","git_url":"git://github.com/kphelps/tantivy.git","ssh_url":"git@github.com:kphelps/tantivy.git","clone_url":"https://github.com/kphelps/tantivy.git","svn_url":"https://github.com/kphelps/tantivy","homepage":"","size":33472,"stargazers_count":0,"watchers_count":0,"language":"Rust","has_issues":false,"has_projects":true,"has_downloads":true,"has_wiki":true,"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"},"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"tantivy-search:master","ref":"master","sha":"08d2cc6c7b87f1899242c98d6588de634796f0a2","user":{"login":"tantivy-search","id":23249022,"avatar_url":"https://avatars3.githubusercontent.com/u/23249022?v=4","gravatar_id":"","url":"https://api.github.com/users/tantivy-search","html_url":"https://github.com/tantivy-search","followers_url":"https://api.github.com/users/tantivy-search/followers","following_url":"https://api.github.com/users/tantivy-search/following{/other_user}","gists_url":"https://api.github.com/users/tantivy-search/gists{/gist_id}","starred_url":"https://api.github.com/users/tantivy-search/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tantivy-search/subscriptions","organizations_url":"https://api.github.com/users/tantivy-search/orgs","repos_url":"https://api.github.com/users/tantivy-search/repos","events_url":"https://api.github.com/users/tantivy-search/events{/privacy}","received_events_url":"https://api.github.com/users/tantivy-search/received_events","type":"Organization","site_admin":false},"repo":{"id":49412556,"name":"tantivy","full_name":"tantivy-search/tantivy","owner":{"login":"tantivy-search","id":23249022,"avatar_url":"https://avatars3.githubusercontent.com/u/23249022?v=4","gravatar_id":"","url":"https://api.github.com/users/tantivy-search","html_url":"https://github.com/tantivy-search","followers_url":"https://api.github.com/users/tantivy-search/followers","following_url":"https://api.github.com/users/tantivy-search/following{/other_user}","gists_url":"https://api.github.com/users/tantivy-search/gists{/gist_id}","starred_url":"https://api.github.com/users/tantivy-search/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tantivy-search/subscriptions","organizations_url":"https://api.github.com/users/tantivy-search/orgs","repos_url":"https://api.github.com/users/tantivy-search/repos","events_url":"https://api.github.com/users/tantivy-search/events{/privacy}","received_events_url":"https://api.github.com/users/tantivy-search/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/tantivy-search/tantivy","description":"Tantivy is a full-text search engine library inspired by Lucene and written in Rust","fork":false,"url":"https://api.github.com/repos/tantivy-search/tantivy","forks_url":"https://api.github.com/repos/tantivy-search/tantivy/forks","keys_url":"https://api.github.com/repos/tantivy-search/tantivy/keys{/key_id}","collaborators_url":"https://api.github.com/repos/tantivy-search/tantivy/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/tantivy-search/tantivy/teams","hooks_url":"https://api.github.com/repos/tantivy-search/tantivy/hooks","issue_events_url":"https://api.github.com/repos/tantivy-search/tantivy/issues/events{/number}","events_url":"https://api.github.com/repos/tantivy-search/tantivy/events","assignees_url":"https://api.github.com/repos/tantivy-search/tantivy/assignees{/user}","branches_url":"https://api.github.com/repos/tantivy-search/tantivy/branches{/branch}","tags_url":"https://api.github.com/repos/tantivy-search/tantivy/tags","blobs_url":"https://api.github.com/repos/tantivy-search/tantivy/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/tantivy-search/tantivy/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/tantivy-search/tantivy/git/refs{/sha}","trees_url":"https://api.github.com/repos/tantivy-search/tantivy/git/trees{/sha}","statuses_url":"https://api.github.com/repos/tantivy-search/tantivy/statuses/{sha}","languages_url":"https://api.github.com/repos/tantivy-search/tantivy/languages","stargazers_url":"https://api.github.com/repos/tantivy-search/tantivy/stargazers","contributors_url":"https://api.github.com/repos/tantivy-search/tantivy/contributors","subscribers_url":"https://api.github.com/repos/tantivy-search/tantivy/subscribers","subscription_url":"https://api.github.com/repos/tantivy-search/tantivy/subscription","commits_url":"https://api.github.com/repos/tantivy-search/tantivy/commits{/sha}","git_commits_url":"https://api.github.com/repos/tantivy-search/tantivy/git/commits{/sha}","comments_url":"https://api.github.com/repos/tantivy-search/tantivy/comments{/number}","issue_comment_url":"https://api.github.com/repos/tantivy-search/tantivy/issues/comments{/number}","contents_url":"https://api.github.com/repos/tantivy-search/tantivy/contents/{+path}","compare_url":"https://api.github.com/repos/tantivy-search/tantivy/compare/{base}...{head}","merges_url":"https://api.github.com/repos/tantivy-search/tantivy/merges","archive_url":"https://api.github.com/repos/tantivy-search/tantivy/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/tantivy-search/tantivy/downloads","issues_url":"https://api.github.com/repos/tantivy-search/tantivy/issues{/number}","pulls_url":"https://api.github.com/repos/tantivy-search/tantivy/pulls{/number}","milestones_url":"https://api.github.com/repos/tantivy-search/tantivy/milestones{/number}","notifications_url":"https://api.github.com/repos/tantivy-search/tantivy/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/tantivy-search/tantivy/labels{/name}","releases_url":"https://api.github.com/repos/tantivy-search/tantivy/releases{/id}","deployments_url":"https://api.github.com/repos/tantivy-search/tantivy/deployments","created_at":"2016-01-11T08:32:16Z","updated_at":"2018-05-16T12:00:20Z","pushed_at":"2018-05-17T11:16:39Z","git_url":"git://github.com/tantivy-search/tantivy.git","ssh_url":"git@github.com:tantivy-search/tantivy.git","clone_url":"https://github.com/tantivy-search/tantivy.git","svn_url":"https://github.com/tantivy-search/tantivy","homepage":"","size":33471,"stargazers_count":712,"watchers_count":712,"language":"Rust","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":45,"mirror_url":null,"archived":false,"open_issues_count":73,"license":{"key":"mit","name":"MIT License","spdx_id":"MIT","url":"https://api.github.com/licenses/mit"},"forks":45,"open_issues":73,"watchers":712,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/tantivy-search/tantivy/pulls/304"},"html":{"href":"https://github.com/tantivy-search/tantivy/pull/304"},"issue":{"href":"https://api.github.com/repos/tantivy-search/tantivy/issues/304"},"comments":{"href":"https://api.github.com/repos/tantivy-search/tantivy/issues/304/comments"},"review_comments":{"href":"https://api.github.com/repos/tantivy-search/tantivy/pulls/304/comments"},"review_comment":{"href":"https://api.github.com/repos/tantivy-search/tantivy/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/tantivy-search/tantivy/pulls/304/commits"},"statuses":{"href":"https://api.github.com/repos/tantivy-search/tantivy/statuses/73933eadd74c58f027e37c6bfd6f312f7ecffca3"}},"author_association":"NONE"}}
{"actor":{"display_login":"fulmicoton"}}