{"action":"closed","number":2,"pull_request":{"url":"https://api.github.com/repos/neurosnap/sentences/pulls/2","id":61201122,"html_url":"https://github.com/neurosnap/sentences/pull/2","diff_url":"https://github.com/neurosnap/sentences/pull/2.diff","patch_url":"https://github.com/neurosnap/sentences/pull/2.patch","issue_url":"https://api.github.com/repos/neurosnap/sentences/issues/2","number":2,"state":"closed","locked":false,"title":"precompile regular expressions for a ~4x speedup","user":{"login":"lloyd","id":39411,"avatar_url":"https://avatars.githubusercontent.com/u/39411?v=3","gravatar_id":"","url":"https://api.github.com/users/lloyd","html_url":"https://github.com/lloyd","followers_url":"https://api.github.com/users/lloyd/followers","following_url":"https://api.github.com/users/lloyd/following{/other_user}","gists_url":"https://api.github.com/users/lloyd/gists{/gist_id}","starred_url":"https://api.github.com/users/lloyd/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lloyd/subscriptions","organizations_url":"https://api.github.com/users/lloyd/orgs","repos_url":"https://api.github.com/users/lloyd/repos","events_url":"https://api.github.com/users/lloyd/events{/privacy}","received_events_url":"https://api.github.com/users/lloyd/received_events","type":"User","site_admin":false},"body":"a hack to precompile regular expressions at application startup time.  For unit tests:\r\n\r\nbefore:\r\n```\r\nok  \tgithub.com/neurosnap/sentences\t0.163s\r\n```\r\nafter:\r\n```\r\nok  \tgithub.com/neurosnap/sentences\t0.040s\r\n```\r\nabout a 4x speedup.\r\n\r\nThen in a more real world test I integrated this into a program that processes text in 150k documents of approximately 4kb a piece.  Can't share the corpus unfortunately cuz it's not public.  but before:\r\n```\r\nreal\t1m35.864s\r\nuser\t16m13.703s\r\nsys\t0m8.947s\r\n```\r\n\r\nafter:\r\n```\r\nreal\t0m15.041s\r\nuser\t2m0.930s\r\nsys\t0m1.777s\r\n```\r\n\r\n8x less cpu used!","created_at":"2016-03-01T06:55:32Z","updated_at":"2016-03-01T07:00:21Z","closed_at":"2016-03-01T07:00:21Z","merged_at":null,"merge_commit_sha":null,"assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/neurosnap/sentences/pulls/2/commits","review_comments_url":"https://api.github.com/repos/neurosnap/sentences/pulls/2/comments","review_comment_url":"https://api.github.com/repos/neurosnap/sentences/pulls/comments{/number}","comments_url":"https://api.github.com/repos/neurosnap/sentences/issues/2/comments","statuses_url":"https://api.github.com/repos/neurosnap/sentences/statuses/f146d0d1a81b7287b92348e2ad89847b4e6fcbe7","head":{"label":"lloyd:faster","ref":"faster","sha":"f146d0d1a81b7287b92348e2ad89847b4e6fcbe7","user":{"login":"lloyd","id":39411,"avatar_url":"https://avatars.githubusercontent.com/u/39411?v=3","gravatar_id":"","url":"https://api.github.com/users/lloyd","html_url":"https://github.com/lloyd","followers_url":"https://api.github.com/users/lloyd/followers","following_url":"https://api.github.com/users/lloyd/following{/other_user}","gists_url":"https://api.github.com/users/lloyd/gists{/gist_id}","starred_url":"https://api.github.com/users/lloyd/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lloyd/subscriptions","organizations_url":"https://api.github.com/users/lloyd/orgs","repos_url":"https://api.github.com/users/lloyd/repos","events_url":"https://api.github.com/users/lloyd/events{/privacy}","received_events_url":"https://api.github.com/users/lloyd/received_events","type":"User","site_admin":false},"repo":{"id":52854692,"name":"sentences","full_name":"lloyd/sentences","owner":{"login":"lloyd","id":39411,"avatar_url":"https://avatars.githubusercontent.com/u/39411?v=3","gravatar_id":"","url":"https://api.github.com/users/lloyd","html_url":"https://github.com/lloyd","followers_url":"https://api.github.com/users/lloyd/followers","following_url":"https://api.github.com/users/lloyd/following{/other_user}","gists_url":"https://api.github.com/users/lloyd/gists{/gist_id}","starred_url":"https://api.github.com/users/lloyd/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lloyd/subscriptions","organizations_url":"https://api.github.com/users/lloyd/orgs","repos_url":"https://api.github.com/users/lloyd/repos","events_url":"https://api.github.com/users/lloyd/events{/privacy}","received_events_url":"https://api.github.com/users/lloyd/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/lloyd/sentences","description":"A multilingual command line sentence tokenizer in Golang","fork":true,"url":"https://api.github.com/repos/lloyd/sentences","forks_url":"https://api.github.com/repos/lloyd/sentences/forks","keys_url":"https://api.github.com/repos/lloyd/sentences/keys{/key_id}","collaborators_url":"https://api.github.com/repos/lloyd/sentences/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/lloyd/sentences/teams","hooks_url":"https://api.github.com/repos/lloyd/sentences/hooks","issue_events_url":"https://api.github.com/repos/lloyd/sentences/issues/events{/number}","events_url":"https://api.github.com/repos/lloyd/sentences/events","assignees_url":"https://api.github.com/repos/lloyd/sentences/assignees{/user}","branches_url":"https://api.github.com/repos/lloyd/sentences/branches{/branch}","tags_url":"https://api.github.com/repos/lloyd/sentences/tags","blobs_url":"https://api.github.com/repos/lloyd/sentences/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/lloyd/sentences/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/lloyd/sentences/git/refs{/sha}","trees_url":"https://api.github.com/repos/lloyd/sentences/git/trees{/sha}","statuses_url":"https://api.github.com/repos/lloyd/sentences/statuses/{sha}","languages_url":"https://api.github.com/repos/lloyd/sentences/languages","stargazers_url":"https://api.github.com/repos/lloyd/sentences/stargazers","contributors_url":"https://api.github.com/repos/lloyd/sentences/contributors","subscribers_url":"https://api.github.com/repos/lloyd/sentences/subscribers","subscription_url":"https://api.github.com/repos/lloyd/sentences/subscription","commits_url":"https://api.github.com/repos/lloyd/sentences/commits{/sha}","git_commits_url":"https://api.github.com/repos/lloyd/sentences/git/commits{/sha}","comments_url":"https://api.github.com/repos/lloyd/sentences/comments{/number}","issue_comment_url":"https://api.github.com/repos/lloyd/sentences/issues/comments{/number}","contents_url":"https://api.github.com/repos/lloyd/sentences/contents/{+path}","compare_url":"https://api.github.com/repos/lloyd/sentences/compare/{base}...{head}","merges_url":"https://api.github.com/repos/lloyd/sentences/merges","archive_url":"https://api.github.com/repos/lloyd/sentences/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/lloyd/sentences/downloads","issues_url":"https://api.github.com/repos/lloyd/sentences/issues{/number}","pulls_url":"https://api.github.com/repos/lloyd/sentences/pulls{/number}","milestones_url":"https://api.github.com/repos/lloyd/sentences/milestones{/number}","notifications_url":"https://api.github.com/repos/lloyd/sentences/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/lloyd/sentences/labels{/name}","releases_url":"https://api.github.com/repos/lloyd/sentences/releases{/id}","deployments_url":"https://api.github.com/repos/lloyd/sentences/deployments","created_at":"2016-03-01T06:44:10Z","updated_at":"2016-03-01T06:44:11Z","pushed_at":"2016-03-01T06:44:52Z","git_url":"git://github.com/lloyd/sentences.git","ssh_url":"git@github.com:lloyd/sentences.git","clone_url":"https://github.com/lloyd/sentences.git","svn_url":"https://github.com/lloyd/sentences","homepage":"http://sentences.erock.io","size":13108,"stargazers_count":0,"watchers_count":0,"language":"Go","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":"neurosnap:master","ref":"master","sha":"10ff89cf183e2565b764dfac8d583ce5ab6c8ce8","user":{"login":"neurosnap","id":1940365,"avatar_url":"https://avatars.githubusercontent.com/u/1940365?v=3","gravatar_id":"","url":"https://api.github.com/users/neurosnap","html_url":"https://github.com/neurosnap","followers_url":"https://api.github.com/users/neurosnap/followers","following_url":"https://api.github.com/users/neurosnap/following{/other_user}","gists_url":"https://api.github.com/users/neurosnap/gists{/gist_id}","starred_url":"https://api.github.com/users/neurosnap/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/neurosnap/subscriptions","organizations_url":"https://api.github.com/users/neurosnap/orgs","repos_url":"https://api.github.com/users/neurosnap/repos","events_url":"https://api.github.com/users/neurosnap/events{/privacy}","received_events_url":"https://api.github.com/users/neurosnap/received_events","type":"User","site_admin":false},"repo":{"id":40334054,"name":"sentences","full_name":"neurosnap/sentences","owner":{"login":"neurosnap","id":1940365,"avatar_url":"https://avatars.githubusercontent.com/u/1940365?v=3","gravatar_id":"","url":"https://api.github.com/users/neurosnap","html_url":"https://github.com/neurosnap","followers_url":"https://api.github.com/users/neurosnap/followers","following_url":"https://api.github.com/users/neurosnap/following{/other_user}","gists_url":"https://api.github.com/users/neurosnap/gists{/gist_id}","starred_url":"https://api.github.com/users/neurosnap/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/neurosnap/subscriptions","organizations_url":"https://api.github.com/users/neurosnap/orgs","repos_url":"https://api.github.com/users/neurosnap/repos","events_url":"https://api.github.com/users/neurosnap/events{/privacy}","received_events_url":"https://api.github.com/users/neurosnap/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/neurosnap/sentences","description":"A multilingual command line sentence tokenizer in Golang","fork":false,"url":"https://api.github.com/repos/neurosnap/sentences","forks_url":"https://api.github.com/repos/neurosnap/sentences/forks","keys_url":"https://api.github.com/repos/neurosnap/sentences/keys{/key_id}","collaborators_url":"https://api.github.com/repos/neurosnap/sentences/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/neurosnap/sentences/teams","hooks_url":"https://api.github.com/repos/neurosnap/sentences/hooks","issue_events_url":"https://api.github.com/repos/neurosnap/sentences/issues/events{/number}","events_url":"https://api.github.com/repos/neurosnap/sentences/events","assignees_url":"https://api.github.com/repos/neurosnap/sentences/assignees{/user}","branches_url":"https://api.github.com/repos/neurosnap/sentences/branches{/branch}","tags_url":"https://api.github.com/repos/neurosnap/sentences/tags","blobs_url":"https://api.github.com/repos/neurosnap/sentences/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/neurosnap/sentences/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/neurosnap/sentences/git/refs{/sha}","trees_url":"https://api.github.com/repos/neurosnap/sentences/git/trees{/sha}","statuses_url":"https://api.github.com/repos/neurosnap/sentences/statuses/{sha}","languages_url":"https://api.github.com/repos/neurosnap/sentences/languages","stargazers_url":"https://api.github.com/repos/neurosnap/sentences/stargazers","contributors_url":"https://api.github.com/repos/neurosnap/sentences/contributors","subscribers_url":"https://api.github.com/repos/neurosnap/sentences/subscribers","subscription_url":"https://api.github.com/repos/neurosnap/sentences/subscription","commits_url":"https://api.github.com/repos/neurosnap/sentences/commits{/sha}","git_commits_url":"https://api.github.com/repos/neurosnap/sentences/git/commits{/sha}","comments_url":"https://api.github.com/repos/neurosnap/sentences/comments{/number}","issue_comment_url":"https://api.github.com/repos/neurosnap/sentences/issues/comments{/number}","contents_url":"https://api.github.com/repos/neurosnap/sentences/contents/{+path}","compare_url":"https://api.github.com/repos/neurosnap/sentences/compare/{base}...{head}","merges_url":"https://api.github.com/repos/neurosnap/sentences/merges","archive_url":"https://api.github.com/repos/neurosnap/sentences/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/neurosnap/sentences/downloads","issues_url":"https://api.github.com/repos/neurosnap/sentences/issues{/number}","pulls_url":"https://api.github.com/repos/neurosnap/sentences/pulls{/number}","milestones_url":"https://api.github.com/repos/neurosnap/sentences/milestones{/number}","notifications_url":"https://api.github.com/repos/neurosnap/sentences/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/neurosnap/sentences/labels{/name}","releases_url":"https://api.github.com/repos/neurosnap/sentences/releases{/id}","deployments_url":"https://api.github.com/repos/neurosnap/sentences/deployments","created_at":"2015-08-07T01:08:20Z","updated_at":"2016-03-01T06:43:54Z","pushed_at":"2016-03-01T06:55:33Z","git_url":"git://github.com/neurosnap/sentences.git","ssh_url":"git@github.com:neurosnap/sentences.git","clone_url":"https://github.com/neurosnap/sentences.git","svn_url":"https://github.com/neurosnap/sentences","homepage":"http://sentences.erock.io","size":13108,"stargazers_count":116,"watchers_count":116,"language":"Go","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":5,"mirror_url":null,"open_issues_count":1,"forks":5,"open_issues":1,"watchers":116,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/neurosnap/sentences/pulls/2"},"html":{"href":"https://github.com/neurosnap/sentences/pull/2"},"issue":{"href":"https://api.github.com/repos/neurosnap/sentences/issues/2"},"comments":{"href":"https://api.github.com/repos/neurosnap/sentences/issues/2/comments"},"review_comments":{"href":"https://api.github.com/repos/neurosnap/sentences/pulls/2/comments"},"review_comment":{"href":"https://api.github.com/repos/neurosnap/sentences/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/neurosnap/sentences/pulls/2/commits"},"statuses":{"href":"https://api.github.com/repos/neurosnap/sentences/statuses/f146d0d1a81b7287b92348e2ad89847b4e6fcbe7"}},"merged":false,"mergeable":false,"mergeable_state":"dirty","merged_by":null,"comments":1,"review_comments":0,"commits":1,"additions":22,"deletions":21,"changed_files":4}}