{"action":"created","comment":{"url":"https://api.github.com/repos/sakura-editor/sakura/pulls/comments/200875620","pull_request_review_id":135265528,"id":200875620,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDIwMDg3NTYyMA==","diff_hunk":"@@ -22,14 +22,16 @@\n #include <deque>\n #include \"sakura_rc.h\"\n \n-#define UICHECK_INTERVAL_MILLISEC 50\t// UI�m�F�̎��ԊԊu\n+#define UICHECK_INTERVAL_MILLISEC 100\t// UI�m�F�̎��ԊԊu\n #define ADDTAIL_INTERVAL_MILLISEC 50\t// ���ʏo�͂̎��ԊԊu\n+#define UIFILENAME_INTERVAL_MILLISEC 15\t// Cancel�_�C�A���O�̃t�@�C�����\\���X�V�Ԋu\n \n CGrepAgent::CGrepAgent()\n : m_bGrepMode( false )\t\t\t/* Grep���[�h�� */\n , m_bGrepRunning( false )\t\t/* Grep������ */\n , m_dwTickAddTail( 0 )\n , m_dwTickUICheck( 0 )\n+, m_dwTickUIFileName( 0 )","path":"sakura_core/CGrepAgent.cpp","position":null,"original_position":14,"commit_id":"fa65002e81421d25d071b186889399bbc74c0979","original_commit_id":"fa65002e81421d25d071b186889399bbc74c0979","user":{"login":"kobake","id":2929454,"node_id":"MDQ6VXNlcjI5Mjk0NTQ=","avatar_url":"https://avatars1.githubusercontent.com/u/2929454?v=4","gravatar_id":"","url":"https://api.github.com/users/kobake","html_url":"https://github.com/kobake","followers_url":"https://api.github.com/users/kobake/followers","following_url":"https://api.github.com/users/kobake/following{/other_user}","gists_url":"https://api.github.com/users/kobake/gists{/gist_id}","starred_url":"https://api.github.com/users/kobake/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kobake/subscriptions","organizations_url":"https://api.github.com/users/kobake/orgs","repos_url":"https://api.github.com/users/kobake/repos","events_url":"https://api.github.com/users/kobake/events{/privacy}","received_events_url":"https://api.github.com/users/kobake/received_events","type":"User","site_admin":false},"body":"この PR よりも前からの問題も含まれますが、`m_dwTick*` 系の 0 初期化はコンストラクタだけでなく `DoGrep()` 先頭でもやったほうが良いです。\r\n\r\nというのは、CGrepAgent のインスタンス作成のタイミングが基本的に一度しかないので、二度目以降の grep 時には前回のタイムスタンプが残った状態から処理が行われてしまいます。（インスタンス生成のタイミング自体があまりイケてない気もしますが、現状そうなっているので意識したほうが良いです）","created_at":"2018-07-09T03:49:15Z","updated_at":"2018-07-09T03:58:34Z","html_url":"https://github.com/sakura-editor/sakura/pull/125#discussion_r200875620","pull_request_url":"https://api.github.com/repos/sakura-editor/sakura/pulls/125","author_association":"MEMBER","_links":{"self":{"href":"https://api.github.com/repos/sakura-editor/sakura/pulls/comments/200875620"},"html":{"href":"https://github.com/sakura-editor/sakura/pull/125#discussion_r200875620"},"pull_request":{"href":"https://api.github.com/repos/sakura-editor/sakura/pulls/125"}}},"pull_request":{"url":"https://api.github.com/repos/sakura-editor/sakura/pulls/125","id":195343981,"node_id":"MDExOlB1bGxSZXF1ZXN0MTk1MzQzOTgx","html_url":"https://github.com/sakura-editor/sakura/pull/125","diff_url":"https://github.com/sakura-editor/sakura/pull/125.diff","patch_url":"https://github.com/sakura-editor/sakura/pull/125.patch","issue_url":"https://api.github.com/repos/sakura-editor/sakura/issues/125","number":125,"state":"open","locked":false,"title":"ファイル読み込みとgrepの高速化","user":{"login":"beru","id":1131125,"node_id":"MDQ6VXNlcjExMzExMjU=","avatar_url":"https://avatars1.githubusercontent.com/u/1131125?v=4","gravatar_id":"","url":"https://api.github.com/users/beru","html_url":"https://github.com/beru","followers_url":"https://api.github.com/users/beru/followers","following_url":"https://api.github.com/users/beru/following{/other_user}","gists_url":"https://api.github.com/users/beru/gists{/gist_id}","starred_url":"https://api.github.com/users/beru/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/beru/subscriptions","organizations_url":"https://api.github.com/users/beru/orgs","repos_url":"https://api.github.com/users/beru/repos","events_url":"https://api.github.com/users/beru/events{/privacy}","received_events_url":"https://api.github.com/users/beru/received_events","type":"User","site_admin":false},"body":"以下の変更を加えることで高速化しました。\r\n\r\n- SJISやUTF8からUnicodeへの文字Encoding変換処理内におけるメモリ確保処理を必要な時にのみ限定\r\n  - 出力先のバッファが引数に指定されている入力元のバッファと異なる場合はその変数を使うようにしました。入力元のバッファと出力先のバッファに同じインスタンスを指定して使っている箇所があるのでインスタンスのアドレス比較で同一かどうか判断しています。\r\n  - UTF-7 や JIS については利用頻度が少ないと判断して手を入れていません。\r\n- GREP処理においてUnicode変換先バッファを使いまわしてヒープマネージャの負担を低減\r\n  - 引数を更に追加しました。まだ3桁ではないので許容範囲でしょうか…。\r\n- `ESI::AutoDetectByHTML` 処理の高速化\r\n  - これは結構効きました。\r\n  - 始め山括弧（LEFT ANGLE BRACKET `<`）の文字一致判定を `memicmp` を呼ぶ前に実行する事で `memicmp` が実行される頻度を低減しました。\r\n- Grep実行時に探索するファイル毎にCancelダイアログのファイル名表示を更新するのではなく、間隔をおいて更新するように変更\r\n  - これに加えてUI確認の時間間隔も50ミリ秒から100ミリ秒に変更しました。\r\n\r\n上記の変更を加える事で、サクラエディタのリポジトリ以下を `hWnd` で フィルタが `*.txt *.h *.cpp *.c *.cc *.hpp` で `サブフォルダからも検索する` にチェックを付けて検索を掛けた際の時間が下記のように速くなりました。\r\n\r\n| `リアルタイムで表示する` 設定値 | 変更前 | 変更後 |\r\n|----|----|----|\r\n| OFF | 930 | 575 |\r\n| ON | 2200 | 990 |\r\n","created_at":"2018-06-16T18:42:21Z","updated_at":"2018-07-09T03:58:34Z","closed_at":null,"merged_at":null,"merge_commit_sha":"148a3ce84ed79770365ec68b31455f0ca16aab83","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[{"id":966918701,"node_id":"MDU6TGFiZWw5NjY5MTg3MDE=","url":"https://api.github.com/repos/sakura-editor/sakura/labels/speed%20up","name":"speed up","color":"c2e0c6","default":false}],"milestone":null,"commits_url":"https://api.github.com/repos/sakura-editor/sakura/pulls/125/commits","review_comments_url":"https://api.github.com/repos/sakura-editor/sakura/pulls/125/comments","review_comment_url":"https://api.github.com/repos/sakura-editor/sakura/pulls/comments{/number}","comments_url":"https://api.github.com/repos/sakura-editor/sakura/issues/125/comments","statuses_url":"https://api.github.com/repos/sakura-editor/sakura/statuses/fa65002e81421d25d071b186889399bbc74c0979","head":{"label":"beru:file_loading_speed_up","ref":"file_loading_speed_up","sha":"fa65002e81421d25d071b186889399bbc74c0979","user":{"login":"beru","id":1131125,"node_id":"MDQ6VXNlcjExMzExMjU=","avatar_url":"https://avatars1.githubusercontent.com/u/1131125?v=4","gravatar_id":"","url":"https://api.github.com/users/beru","html_url":"https://github.com/beru","followers_url":"https://api.github.com/users/beru/followers","following_url":"https://api.github.com/users/beru/following{/other_user}","gists_url":"https://api.github.com/users/beru/gists{/gist_id}","starred_url":"https://api.github.com/users/beru/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/beru/subscriptions","organizations_url":"https://api.github.com/users/beru/orgs","repos_url":"https://api.github.com/users/beru/repos","events_url":"https://api.github.com/users/beru/events{/privacy}","received_events_url":"https://api.github.com/users/beru/received_events","type":"User","site_admin":false},"repo":{"id":136746507,"node_id":"MDEwOlJlcG9zaXRvcnkxMzY3NDY1MDc=","name":"sakura","full_name":"beru/sakura","owner":{"login":"beru","id":1131125,"node_id":"MDQ6VXNlcjExMzExMjU=","avatar_url":"https://avatars1.githubusercontent.com/u/1131125?v=4","gravatar_id":"","url":"https://api.github.com/users/beru","html_url":"https://github.com/beru","followers_url":"https://api.github.com/users/beru/followers","following_url":"https://api.github.com/users/beru/following{/other_user}","gists_url":"https://api.github.com/users/beru/gists{/gist_id}","starred_url":"https://api.github.com/users/beru/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/beru/subscriptions","organizations_url":"https://api.github.com/users/beru/orgs","repos_url":"https://api.github.com/users/beru/repos","events_url":"https://api.github.com/users/beru/events{/privacy}","received_events_url":"https://api.github.com/users/beru/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/beru/sakura","description":"SourceForgeから移行。VS2017ビルド確認済。","fork":true,"url":"https://api.github.com/repos/beru/sakura","forks_url":"https://api.github.com/repos/beru/sakura/forks","keys_url":"https://api.github.com/repos/beru/sakura/keys{/key_id}","collaborators_url":"https://api.github.com/repos/beru/sakura/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/beru/sakura/teams","hooks_url":"https://api.github.com/repos/beru/sakura/hooks","issue_events_url":"https://api.github.com/repos/beru/sakura/issues/events{/number}","events_url":"https://api.github.com/repos/beru/sakura/events","assignees_url":"https://api.github.com/repos/beru/sakura/assignees{/user}","branches_url":"https://api.github.com/repos/beru/sakura/branches{/branch}","tags_url":"https://api.github.com/repos/beru/sakura/tags","blobs_url":"https://api.github.com/repos/beru/sakura/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/beru/sakura/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/beru/sakura/git/refs{/sha}","trees_url":"https://api.github.com/repos/beru/sakura/git/trees{/sha}","statuses_url":"https://api.github.com/repos/beru/sakura/statuses/{sha}","languages_url":"https://api.github.com/repos/beru/sakura/languages","stargazers_url":"https://api.github.com/repos/beru/sakura/stargazers","contributors_url":"https://api.github.com/repos/beru/sakura/contributors","subscribers_url":"https://api.github.com/repos/beru/sakura/subscribers","subscription_url":"https://api.github.com/repos/beru/sakura/subscription","commits_url":"https://api.github.com/repos/beru/sakura/commits{/sha}","git_commits_url":"https://api.github.com/repos/beru/sakura/git/commits{/sha}","comments_url":"https://api.github.com/repos/beru/sakura/comments{/number}","issue_comment_url":"https://api.github.com/repos/beru/sakura/issues/comments{/number}","contents_url":"https://api.github.com/repos/beru/sakura/contents/{+path}","compare_url":"https://api.github.com/repos/beru/sakura/compare/{base}...{head}","merges_url":"https://api.github.com/repos/beru/sakura/merges","archive_url":"https://api.github.com/repos/beru/sakura/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/beru/sakura/downloads","issues_url":"https://api.github.com/repos/beru/sakura/issues{/number}","pulls_url":"https://api.github.com/repos/beru/sakura/pulls{/number}","milestones_url":"https://api.github.com/repos/beru/sakura/milestones{/number}","notifications_url":"https://api.github.com/repos/beru/sakura/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/beru/sakura/labels{/name}","releases_url":"https://api.github.com/repos/beru/sakura/releases{/id}","deployments_url":"https://api.github.com/repos/beru/sakura/deployments","created_at":"2018-06-09T18:03:32Z","updated_at":"2018-06-09T18:03:37Z","pushed_at":"2018-07-08T20:09:12Z","git_url":"git://github.com/beru/sakura.git","ssh_url":"git@github.com:beru/sakura.git","clone_url":"https://github.com/beru/sakura.git","svn_url":"https://github.com/beru/sakura","homepage":"","size":17080,"stargazers_count":0,"watchers_count":0,"language":"C++","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":null,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"sakura-editor:master","ref":"master","sha":"61916645567f763fdbf564e1f92fa6e2233059f4","user":{"login":"sakura-editor","id":39432189,"node_id":"MDEyOk9yZ2FuaXphdGlvbjM5NDMyMTg5","avatar_url":"https://avatars3.githubusercontent.com/u/39432189?v=4","gravatar_id":"","url":"https://api.github.com/users/sakura-editor","html_url":"https://github.com/sakura-editor","followers_url":"https://api.github.com/users/sakura-editor/followers","following_url":"https://api.github.com/users/sakura-editor/following{/other_user}","gists_url":"https://api.github.com/users/sakura-editor/gists{/gist_id}","starred_url":"https://api.github.com/users/sakura-editor/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sakura-editor/subscriptions","organizations_url":"https://api.github.com/users/sakura-editor/orgs","repos_url":"https://api.github.com/users/sakura-editor/repos","events_url":"https://api.github.com/users/sakura-editor/events{/privacy}","received_events_url":"https://api.github.com/users/sakura-editor/received_events","type":"Organization","site_admin":false},"repo":{"id":134057969,"node_id":"MDEwOlJlcG9zaXRvcnkxMzQwNTc5Njk=","name":"sakura","full_name":"sakura-editor/sakura","owner":{"login":"sakura-editor","id":39432189,"node_id":"MDEyOk9yZ2FuaXphdGlvbjM5NDMyMTg5","avatar_url":"https://avatars3.githubusercontent.com/u/39432189?v=4","gravatar_id":"","url":"https://api.github.com/users/sakura-editor","html_url":"https://github.com/sakura-editor","followers_url":"https://api.github.com/users/sakura-editor/followers","following_url":"https://api.github.com/users/sakura-editor/following{/other_user}","gists_url":"https://api.github.com/users/sakura-editor/gists{/gist_id}","starred_url":"https://api.github.com/users/sakura-editor/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sakura-editor/subscriptions","organizations_url":"https://api.github.com/users/sakura-editor/orgs","repos_url":"https://api.github.com/users/sakura-editor/repos","events_url":"https://api.github.com/users/sakura-editor/events{/privacy}","received_events_url":"https://api.github.com/users/sakura-editor/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/sakura-editor/sakura","description":"SourceForgeから移行。VS2017ビルド確認済。","fork":false,"url":"https://api.github.com/repos/sakura-editor/sakura","forks_url":"https://api.github.com/repos/sakura-editor/sakura/forks","keys_url":"https://api.github.com/repos/sakura-editor/sakura/keys{/key_id}","collaborators_url":"https://api.github.com/repos/sakura-editor/sakura/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/sakura-editor/sakura/teams","hooks_url":"https://api.github.com/repos/sakura-editor/sakura/hooks","issue_events_url":"https://api.github.com/repos/sakura-editor/sakura/issues/events{/number}","events_url":"https://api.github.com/repos/sakura-editor/sakura/events","assignees_url":"https://api.github.com/repos/sakura-editor/sakura/assignees{/user}","branches_url":"https://api.github.com/repos/sakura-editor/sakura/branches{/branch}","tags_url":"https://api.github.com/repos/sakura-editor/sakura/tags","blobs_url":"https://api.github.com/repos/sakura-editor/sakura/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/sakura-editor/sakura/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/sakura-editor/sakura/git/refs{/sha}","trees_url":"https://api.github.com/repos/sakura-editor/sakura/git/trees{/sha}","statuses_url":"https://api.github.com/repos/sakura-editor/sakura/statuses/{sha}","languages_url":"https://api.github.com/repos/sakura-editor/sakura/languages","stargazers_url":"https://api.github.com/repos/sakura-editor/sakura/stargazers","contributors_url":"https://api.github.com/repos/sakura-editor/sakura/contributors","subscribers_url":"https://api.github.com/repos/sakura-editor/sakura/subscribers","subscription_url":"https://api.github.com/repos/sakura-editor/sakura/subscription","commits_url":"https://api.github.com/repos/sakura-editor/sakura/commits{/sha}","git_commits_url":"https://api.github.com/repos/sakura-editor/sakura/git/commits{/sha}","comments_url":"https://api.github.com/repos/sakura-editor/sakura/comments{/number}","issue_comment_url":"https://api.github.com/repos/sakura-editor/sakura/issues/comments{/number}","contents_url":"https://api.github.com/repos/sakura-editor/sakura/contents/{+path}","compare_url":"https://api.github.com/repos/sakura-editor/sakura/compare/{base}...{head}","merges_url":"https://api.github.com/repos/sakura-editor/sakura/merges","archive_url":"https://api.github.com/repos/sakura-editor/sakura/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/sakura-editor/sakura/downloads","issues_url":"https://api.github.com/repos/sakura-editor/sakura/issues{/number}","pulls_url":"https://api.github.com/repos/sakura-editor/sakura/pulls{/number}","milestones_url":"https://api.github.com/repos/sakura-editor/sakura/milestones{/number}","notifications_url":"https://api.github.com/repos/sakura-editor/sakura/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/sakura-editor/sakura/labels{/name}","releases_url":"https://api.github.com/repos/sakura-editor/sakura/releases{/id}","deployments_url":"https://api.github.com/repos/sakura-editor/sakura/deployments","created_at":"2018-05-19T12:02:06Z","updated_at":"2018-07-09T01:26:47Z","pushed_at":"2018-07-08T20:11:25Z","git_url":"git://github.com/sakura-editor/sakura.git","ssh_url":"git@github.com:sakura-editor/sakura.git","clone_url":"https://github.com/sakura-editor/sakura.git","svn_url":"https://github.com/sakura-editor/sakura","homepage":"","size":17080,"stargazers_count":175,"watchers_count":175,"language":"C++","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":11,"mirror_url":null,"archived":false,"open_issues_count":71,"license":null,"forks":11,"open_issues":71,"watchers":175,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/sakura-editor/sakura/pulls/125"},"html":{"href":"https://github.com/sakura-editor/sakura/pull/125"},"issue":{"href":"https://api.github.com/repos/sakura-editor/sakura/issues/125"},"comments":{"href":"https://api.github.com/repos/sakura-editor/sakura/issues/125/comments"},"review_comments":{"href":"https://api.github.com/repos/sakura-editor/sakura/pulls/125/comments"},"review_comment":{"href":"https://api.github.com/repos/sakura-editor/sakura/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/sakura-editor/sakura/pulls/125/commits"},"statuses":{"href":"https://api.github.com/repos/sakura-editor/sakura/statuses/fa65002e81421d25d071b186889399bbc74c0979"}},"author_association":"CONTRIBUTOR"}}
{"actor":{"display_login":"kobake"}}