{"action":"opened","number":2297,"pull_request":{"url":"https://api.github.com/repos/realm/realm-core/pulls/2297","id":93493898,"html_url":"https://github.com/realm/realm-core/pull/2297","diff_url":"https://github.com/realm/realm-core/pull/2297.diff","patch_url":"https://github.com/realm/realm-core/pull/2297.patch","issue_url":"https://api.github.com/repos/realm/realm-core/issues/2297","number":2297,"state":"open","locked":false,"title":"Optimized contains queries to use Boyer-Moore search","user":{"login":"astigsen","id":69422,"avatar_url":"https://avatars.githubusercontent.com/u/69422?v=3","gravatar_id":"","url":"https://api.github.com/users/astigsen","html_url":"https://github.com/astigsen","followers_url":"https://api.github.com/users/astigsen/followers","following_url":"https://api.github.com/users/astigsen/following{/other_user}","gists_url":"https://api.github.com/users/astigsen/gists{/gist_id}","starred_url":"https://api.github.com/users/astigsen/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/astigsen/subscriptions","organizations_url":"https://api.github.com/users/astigsen/orgs","repos_url":"https://api.github.com/users/astigsen/repos","events_url":"https://api.github.com/users/astigsen/events{/privacy}","received_events_url":"https://api.github.com/users/astigsen/received_events","type":"User","site_admin":false},"body":"I had a lot of off time on my fight from CPH, so I spend a bit of it playing around with optimizing the contains search. Being on the plane, I had to implement Boyer-Moore from memory, so please review thoroughly ;-)\r\n\r\nWhen doing a case insensitive search over 300,000 rows it improves the search time from 7.49s to 542.93ms, so around a 13x improvement.","created_at":"2016-11-14T00:23:01Z","updated_at":"2016-11-14T00:23:01Z","closed_at":null,"merged_at":null,"merge_commit_sha":null,"assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/realm/realm-core/pulls/2297/commits","review_comments_url":"https://api.github.com/repos/realm/realm-core/pulls/2297/comments","review_comment_url":"https://api.github.com/repos/realm/realm-core/pulls/comments{/number}","comments_url":"https://api.github.com/repos/realm/realm-core/issues/2297/comments","statuses_url":"https://api.github.com/repos/realm/realm-core/statuses/86a0356739427915bf030e63c11aefd2ea7fddbc","head":{"label":"realm:as-boyermoore","ref":"as-boyermoore","sha":"86a0356739427915bf030e63c11aefd2ea7fddbc","user":{"login":"realm","id":7575099,"avatar_url":"https://avatars.githubusercontent.com/u/7575099?v=3","gravatar_id":"","url":"https://api.github.com/users/realm","html_url":"https://github.com/realm","followers_url":"https://api.github.com/users/realm/followers","following_url":"https://api.github.com/users/realm/following{/other_user}","gists_url":"https://api.github.com/users/realm/gists{/gist_id}","starred_url":"https://api.github.com/users/realm/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/realm/subscriptions","organizations_url":"https://api.github.com/users/realm/orgs","repos_url":"https://api.github.com/users/realm/repos","events_url":"https://api.github.com/users/realm/events{/privacy}","received_events_url":"https://api.github.com/users/realm/received_events","type":"Organization","site_admin":false},"repo":{"id":1917262,"name":"realm-core","full_name":"realm/realm-core","owner":{"login":"realm","id":7575099,"avatar_url":"https://avatars.githubusercontent.com/u/7575099?v=3","gravatar_id":"","url":"https://api.github.com/users/realm","html_url":"https://github.com/realm","followers_url":"https://api.github.com/users/realm/followers","following_url":"https://api.github.com/users/realm/following{/other_user}","gists_url":"https://api.github.com/users/realm/gists{/gist_id}","starred_url":"https://api.github.com/users/realm/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/realm/subscriptions","organizations_url":"https://api.github.com/users/realm/orgs","repos_url":"https://api.github.com/users/realm/repos","events_url":"https://api.github.com/users/realm/events{/privacy}","received_events_url":"https://api.github.com/users/realm/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/realm/realm-core","description":"Core database component for the Realm Mobile Database SDKs","fork":false,"url":"https://api.github.com/repos/realm/realm-core","forks_url":"https://api.github.com/repos/realm/realm-core/forks","keys_url":"https://api.github.com/repos/realm/realm-core/keys{/key_id}","collaborators_url":"https://api.github.com/repos/realm/realm-core/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/realm/realm-core/teams","hooks_url":"https://api.github.com/repos/realm/realm-core/hooks","issue_events_url":"https://api.github.com/repos/realm/realm-core/issues/events{/number}","events_url":"https://api.github.com/repos/realm/realm-core/events","assignees_url":"https://api.github.com/repos/realm/realm-core/assignees{/user}","branches_url":"https://api.github.com/repos/realm/realm-core/branches{/branch}","tags_url":"https://api.github.com/repos/realm/realm-core/tags","blobs_url":"https://api.github.com/repos/realm/realm-core/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/realm/realm-core/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/realm/realm-core/git/refs{/sha}","trees_url":"https://api.github.com/repos/realm/realm-core/git/trees{/sha}","statuses_url":"https://api.github.com/repos/realm/realm-core/statuses/{sha}","languages_url":"https://api.github.com/repos/realm/realm-core/languages","stargazers_url":"https://api.github.com/repos/realm/realm-core/stargazers","contributors_url":"https://api.github.com/repos/realm/realm-core/contributors","subscribers_url":"https://api.github.com/repos/realm/realm-core/subscribers","subscription_url":"https://api.github.com/repos/realm/realm-core/subscription","commits_url":"https://api.github.com/repos/realm/realm-core/commits{/sha}","git_commits_url":"https://api.github.com/repos/realm/realm-core/git/commits{/sha}","comments_url":"https://api.github.com/repos/realm/realm-core/comments{/number}","issue_comment_url":"https://api.github.com/repos/realm/realm-core/issues/comments{/number}","contents_url":"https://api.github.com/repos/realm/realm-core/contents/{+path}","compare_url":"https://api.github.com/repos/realm/realm-core/compare/{base}...{head}","merges_url":"https://api.github.com/repos/realm/realm-core/merges","archive_url":"https://api.github.com/repos/realm/realm-core/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/realm/realm-core/downloads","issues_url":"https://api.github.com/repos/realm/realm-core/issues{/number}","pulls_url":"https://api.github.com/repos/realm/realm-core/pulls{/number}","milestones_url":"https://api.github.com/repos/realm/realm-core/milestones{/number}","notifications_url":"https://api.github.com/repos/realm/realm-core/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/realm/realm-core/labels{/name}","releases_url":"https://api.github.com/repos/realm/realm-core/releases{/id}","deployments_url":"https://api.github.com/repos/realm/realm-core/deployments","created_at":"2011-06-18T21:18:46Z","updated_at":"2016-11-11T10:21:38Z","pushed_at":"2016-11-14T00:23:01Z","git_url":"git://github.com/realm/realm-core.git","ssh_url":"git@github.com:realm/realm-core.git","clone_url":"https://github.com/realm/realm-core.git","svn_url":"https://github.com/realm/realm-core","homepage":"https://realm.io","size":52223,"stargazers_count":446,"watchers_count":446,"language":"C++","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":17,"mirror_url":null,"open_issues_count":182,"forks":17,"open_issues":182,"watchers":446,"default_branch":"master"}},"base":{"label":"realm:develop","ref":"develop","sha":"1c4327bfc82b6ca8559aba1d5b45d4911545ada6","user":{"login":"realm","id":7575099,"avatar_url":"https://avatars.githubusercontent.com/u/7575099?v=3","gravatar_id":"","url":"https://api.github.com/users/realm","html_url":"https://github.com/realm","followers_url":"https://api.github.com/users/realm/followers","following_url":"https://api.github.com/users/realm/following{/other_user}","gists_url":"https://api.github.com/users/realm/gists{/gist_id}","starred_url":"https://api.github.com/users/realm/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/realm/subscriptions","organizations_url":"https://api.github.com/users/realm/orgs","repos_url":"https://api.github.com/users/realm/repos","events_url":"https://api.github.com/users/realm/events{/privacy}","received_events_url":"https://api.github.com/users/realm/received_events","type":"Organization","site_admin":false},"repo":{"id":1917262,"name":"realm-core","full_name":"realm/realm-core","owner":{"login":"realm","id":7575099,"avatar_url":"https://avatars.githubusercontent.com/u/7575099?v=3","gravatar_id":"","url":"https://api.github.com/users/realm","html_url":"https://github.com/realm","followers_url":"https://api.github.com/users/realm/followers","following_url":"https://api.github.com/users/realm/following{/other_user}","gists_url":"https://api.github.com/users/realm/gists{/gist_id}","starred_url":"https://api.github.com/users/realm/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/realm/subscriptions","organizations_url":"https://api.github.com/users/realm/orgs","repos_url":"https://api.github.com/users/realm/repos","events_url":"https://api.github.com/users/realm/events{/privacy}","received_events_url":"https://api.github.com/users/realm/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/realm/realm-core","description":"Core database component for the Realm Mobile Database SDKs","fork":false,"url":"https://api.github.com/repos/realm/realm-core","forks_url":"https://api.github.com/repos/realm/realm-core/forks","keys_url":"https://api.github.com/repos/realm/realm-core/keys{/key_id}","collaborators_url":"https://api.github.com/repos/realm/realm-core/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/realm/realm-core/teams","hooks_url":"https://api.github.com/repos/realm/realm-core/hooks","issue_events_url":"https://api.github.com/repos/realm/realm-core/issues/events{/number}","events_url":"https://api.github.com/repos/realm/realm-core/events","assignees_url":"https://api.github.com/repos/realm/realm-core/assignees{/user}","branches_url":"https://api.github.com/repos/realm/realm-core/branches{/branch}","tags_url":"https://api.github.com/repos/realm/realm-core/tags","blobs_url":"https://api.github.com/repos/realm/realm-core/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/realm/realm-core/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/realm/realm-core/git/refs{/sha}","trees_url":"https://api.github.com/repos/realm/realm-core/git/trees{/sha}","statuses_url":"https://api.github.com/repos/realm/realm-core/statuses/{sha}","languages_url":"https://api.github.com/repos/realm/realm-core/languages","stargazers_url":"https://api.github.com/repos/realm/realm-core/stargazers","contributors_url":"https://api.github.com/repos/realm/realm-core/contributors","subscribers_url":"https://api.github.com/repos/realm/realm-core/subscribers","subscription_url":"https://api.github.com/repos/realm/realm-core/subscription","commits_url":"https://api.github.com/repos/realm/realm-core/commits{/sha}","git_commits_url":"https://api.github.com/repos/realm/realm-core/git/commits{/sha}","comments_url":"https://api.github.com/repos/realm/realm-core/comments{/number}","issue_comment_url":"https://api.github.com/repos/realm/realm-core/issues/comments{/number}","contents_url":"https://api.github.com/repos/realm/realm-core/contents/{+path}","compare_url":"https://api.github.com/repos/realm/realm-core/compare/{base}...{head}","merges_url":"https://api.github.com/repos/realm/realm-core/merges","archive_url":"https://api.github.com/repos/realm/realm-core/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/realm/realm-core/downloads","issues_url":"https://api.github.com/repos/realm/realm-core/issues{/number}","pulls_url":"https://api.github.com/repos/realm/realm-core/pulls{/number}","milestones_url":"https://api.github.com/repos/realm/realm-core/milestones{/number}","notifications_url":"https://api.github.com/repos/realm/realm-core/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/realm/realm-core/labels{/name}","releases_url":"https://api.github.com/repos/realm/realm-core/releases{/id}","deployments_url":"https://api.github.com/repos/realm/realm-core/deployments","created_at":"2011-06-18T21:18:46Z","updated_at":"2016-11-11T10:21:38Z","pushed_at":"2016-11-14T00:23:01Z","git_url":"git://github.com/realm/realm-core.git","ssh_url":"git@github.com:realm/realm-core.git","clone_url":"https://github.com/realm/realm-core.git","svn_url":"https://github.com/realm/realm-core","homepage":"https://realm.io","size":52223,"stargazers_count":446,"watchers_count":446,"language":"C++","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":17,"mirror_url":null,"open_issues_count":182,"forks":17,"open_issues":182,"watchers":446,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/realm/realm-core/pulls/2297"},"html":{"href":"https://github.com/realm/realm-core/pull/2297"},"issue":{"href":"https://api.github.com/repos/realm/realm-core/issues/2297"},"comments":{"href":"https://api.github.com/repos/realm/realm-core/issues/2297/comments"},"review_comments":{"href":"https://api.github.com/repos/realm/realm-core/pulls/2297/comments"},"review_comment":{"href":"https://api.github.com/repos/realm/realm-core/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/realm/realm-core/pulls/2297/commits"},"statuses":{"href":"https://api.github.com/repos/realm/realm-core/statuses/86a0356739427915bf030e63c11aefd2ea7fddbc"}},"merged":false,"mergeable":null,"mergeable_state":"unknown","merged_by":null,"comments":0,"review_comments":0,"commits":1,"additions":288,"deletions":32,"changed_files":7}}
{"actor":{"display_login":"astigsen"}}