Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ファイル保存の副次処理調整 #1054

Merged
merged 1 commit into from
Sep 23, 2019
Merged

ファイル保存の副次処理調整 #1054

merged 1 commit into from
Sep 23, 2019

Conversation

beru
Copy link
Contributor

@beru beru commented Sep 23, 2019

PR の目的

下記の2つの変更を行う目的があります。

  • ファイル保存処理中のユーザーへの通知やメッセージループ回し(処理中のユーザー操作を可能にする)処理の呼び出しを、1024行間隔で行う方法から一定時間(33ミリ秒)間隔で行う方法に変更

  • ファイル保存処理後に呼び出す設定変更の反映呼び出し(CEditDoc::OnChangeSetting)は文書種別が変更になった時だけ行うように変更

カテゴリ

  • 速度向上

PR の背景

1行の文字数が少なく行数がやたらと多いファイルの場合(そんなファイルを日常的には扱わないので特殊なケースですが…)、1024行間隔で実行する方法だと必要以上に頻繁に処理が呼び出されてしまいます。UI更新は操作する人間向けの処理なので一定時間間隔で行う方法が良いと考えています。

設定変更の反映呼び出し(CEditDoc::OnChangeSetting)は色々な処理の呼び出しを行うので必要のないケースでは呼び出しをしない方が処理が軽くなります。CEditDoc::OnChangeSetting から呼び出す処理の中でも特に処理が重くなりがちなのは、 CLayoutMgr::SetLayoutInfo 経由で呼び出される CLayoutMgr::_DoLayout です。

PR のメリット

ファイル保存時の処理が少し軽くなるケースが増えます。

PR のデメリット (トレードオフとかあれば)

いつもの事ですが判定記述が増えるとコード量が増えて可読性が下がってメンテナンスの難易度が上がります。コメントは入れていますが…。

保存時に文書種別が変更されていない場合でももしかしたら設定変更の反映呼び出しを行った方が良い場合があるかもしれないので(把握していない)その場合は不具合になります。

PR の影響範囲

ファイル保存時の処理

関連チケット

#1050

…秒)間隔で行う方法に変更

ファイル保存処理後に呼び出す設定変更の反映呼び出し(CEditDoc::OnChangeSetting)は文書種別が変更になった時だけ行うように変更
@beru beru added the 🚅 speed up 🚀 高速化 label Sep 23, 2019
@AppVeyorBot
Copy link

Build sakura 1.0.2267 completed (commit 32b1681907 by @beru)

Copy link
Contributor

@berryzplus berryzplus left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

特に問題ないと思います。

@beru
Copy link
Contributor Author

beru commented Sep 23, 2019

レビューありがとうございました。Mergeします。
もし問題が見つかったら別PRで対処します。

@beru beru merged commit 3d71de1 into sakura-editor:master Sep 23, 2019
@beru beru deleted the WriteFile_From_CDocLineMgr branch September 23, 2019 02:29
@m-tmatma m-tmatma added this to the v2.4.0 milestone Dec 29, 2019
HoppingTappy pushed a commit to HoppingTappy/sakura that referenced this pull request Jun 16, 2020
…neMgr

ファイル保存の副次処理調整
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants