Skip to content
This repository was archived by the owner on Aug 31, 2021. It is now read-only.

[[ Bugfix 21305 ]] Improve performance of stackfile saving on Windows #7342

Merged
merged 2 commits into from
Apr 30, 2020

Conversation

runrevmark
Copy link
Contributor

This patch adds a cache of some critical system metrics which are used when writing field object content to a stackfile. Previously these metrics would be queried directly every time an MCBlock was serialized, they are now queried on startup and when a broadcast notification is received which indicates they may have changed. This makes a substantial difference to saving stackfiles which contain lots of text stored in fields.

Partially closes https://quality.livecode.com/show_bug.cgi?id=21305

This patch caches the screen dpi and non-client metrics in the MCScreenDC
class on open, with them being updated whenever a WM_SETTINGCHANGE or
WM_DISPLAYCHANGE message is received. This metrics are used frequently,
especially when serializing fields, and caching vastly improves the speed
of the operations using them.

To facilitate the caching and update of the metrics, a new method
`updatemetrics()` has been added to MCScreenDC, which is called when opened
and during `processdesktopchanged()`.
@runrevmark runrevmark added the bug label Apr 30, 2020
@runrevmark runrevmark added this to the 9.6.0-rc-1 milestone Apr 30, 2020
@runrevmark runrevmark requested a review from livecodeian April 30, 2020 06:55
@runrevmark runrevmark self-assigned this Apr 30, 2020
This patch adds a release note for bug 21305 where stackfile saving
on Windows was considerably slower than other platforms.
@livecodeian
Copy link
Contributor

@livecode-vulcan review ok e8c93ea

@livecode-vulcan
Copy link
Contributor

💙 review by @livecodeian ok e8c93ea

livecode-vulcan added a commit that referenced this pull request Apr 30, 2020
[[ Bugfix 21305 ]] Improve performance of stackfile saving on Windows

This patch adds a cache of some critical system metrics which are used when writing field object content to a stackfile. Previously these metrics would be queried directly every time an `MCBlock` was serialized, they are now queried on startup and when a broadcast notification is received which indicates they may have changed. This makes a substantial difference to saving stackfiles which contain lots of text stored in fields.

Partially closes https://quality.livecode.com/show_bug.cgi?id=21305
@livecode-vulcan
Copy link
Contributor

😎 test success e8c93ea

  • try-community-armv6-android-sdk26_ndk16r15: success
  • try-community-armv7-android-ndk16r15: success
  • try-community-arm64-android-ndk16r15: success
  • try-community-x86-android-ndk16r15: success
  • try-community-x86_64-android-ndk16r15: success
  • try-community-js-emscripten-sdk1.35: success
  • try-community-universal-ios-iphoneos13.4: success
  • try-community-universal-ios-iphonesimulator13.4: success
  • try-community-universal-mac-macosx10.9: success
  • try-community-x86-linux-debian8: success
  • try-community-x86_64-linux-debian8: success
  • try-community-x86-win32: success
  • try-community-x86_64-win32: success

@runrevmark runrevmark merged commit c040fb3 into livecode:develop Apr 30, 2020
@runrevmark runrevmark deleted the bugfix-21305-api branch April 30, 2020 10:46
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants