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
[BUG] Windows - Opening settings is slow -> Some registry keys are read 72 times #3027
Comments
Caching is easy, cache invalidation isn't. By now, it would make sense if you would build QOwnNotes from source and run it in the debugger to see what's going on... |
Portable mode was just to replicate on my existing system without any of my stuff inherited. Can try this in portable mode too and see if it shows similar behavior, but then not against Windows registry. Alright. I've started reading up on it, but C++ and Qt is not my strong suite, quite new for me. I haven't even been able to set up a development environment. What is a good IDE to use on Windows? I've found "Another Qt Installer" and found an example install parameter that seems to work. Just have to get the correct Qt version, this was just an example:
|
QtCreator via https://www.qt.io/download-qt-installer-oss |
After many hours I've managed to build it, but the artifact won't run. The build instructions are not very clear for a C++ novice like myself.
If you get
I then tried using the build script used inside GitHub actions instead.
The steps I took to build on Windows: Click to viewInstall required tools
Install C++ build tools (gcc, g++ and make)# Open msys2
msys2
# Update repositories - Exit and reopen msys2 if asked
pacman --sync --refresh --sysupgrade
pacman --sync --sysupgrade
# Install make, GCC and G++
pacman --sync --needed base-devel make mingw-w64-x86_64-toolchain
# Exit from msys2
exit Build from Windows Terminal using PowerShell v7.4.2# Assets
$BuildPath = [string] '{0}\Temp\Build' -f $env:LOCALAPPDATA
$RepoPath = [string] '{0}\QOwnNotes' -f $BuildPath
$QtPath = [string] '{0}\Qt' -f $BuildPath
$QtVersion = [string] '5.15.2'
# Initialize build dir
if ([System.IO.Directory]::Exists($BuildPath)) {
$null = [System.IO.Directory]::Delete($BuildPath,$true)
}
$null = [System.IO.Directory]::CreateDirectory($BuildPath)
# Clone QOwnNotes
Set-Location -Path $BuildPath
git clone --depth 1 --branch main https://github.com/pbek/QOwnNotes.git
Set-Location -Path $RepoPath
git submodule update --init
# Install Qt next to the repo directory for the build script to work
aqt install-qt windows desktop $QtVersion win64_mingw81 --outputdir $QtPath
# Add env variables to current process (does not persist)
[System.Environment]::SetEnvironmentVariable(
'PATH',
(
$env:Path,
('{0}\{1}\mingw81_64\bin' -f $QtPath, $QtVersion),
('{0}\scoop\apps\msys2\current\usr\bin' -f $env:USERPROFILE),
('{0}\scoop\apps\msys2\current\mingw64\bin' -f $env:USERPROFILE) -join ';' -replace ';{2,}', ';'
),
'Process'
)
# Make sure some of the known build tools are avaiable
'g++.exe','gcc.exe','make.exe','qmake.exe','windeployqt.exe' | ForEach-Object -Process {
Get-Command -Name $_
}
# Build using script
Set-Location -Path ('{0}\src' -f $RepoPath)
$ErrorActionPreference = 'Stop'
& '..\build-systems\github\windows\build-zip.ps1' Do you see any obvious flaws here? Edit: I seem to have hit the same problem as here: |
Oh, no. 😱 |
Doing release builds on Windows (or macOS) is a nightmare and took me a long time to chisel into shape on every platform I tried to do release builds (GitHub, AppVayor, ...). |
Learning by doing (it wrong 😁). I wanted to avoid having to register for Qt if possible. One can install Qt Creator with Scoop, which downloads and extracts a 7z archive from Qt, but it did not have much working out of the box. Not the Qt Maintenance tool either. I guess next step is to register with Qt and install Qt Creator using their installer. Using Dependencies ( https://github.com/lucasg/Dependencies ) it seems QOwnNotes.exe that I built on Windows 11 23H2 22631.x complains on not finding following DLLs:
Loading QOwnNotes.exe from relases ( https://github.com/pbek/QOwnNotes/releases/download/v24.5.4/QOwnNotes.zip ) does not show any missing DLLs. Kind of related issues: |
With a proper Qt Creator installation, then running QOwnNotes in debug mode (F5) with Qt 5.15.2 MinGW 32-bit. Opening settings gives following Application Output: With telemtry and heartbeat enabled
With heartbeat and telemtry disabled
So, both some TLS issues, and color space (sRGB)? I just realised I have no idea what I'm doing, or what I should do or look for. |
...the hard way. 😊
Yes, that's a pain in the neck. One more reason I don't like doing anything on Windows. 😁
Nice tool! |
I've no idea about the TLS issues. The libpng warning is a common issue you can't really get around, that's why I'm ignoring the warning in QOwnNotes. |
|
Expected behaviour
Opening settings should only trigger reading a registry value once, unless it's already cached in the application?
Actual behaviour
Some registry keys, like "HKCU\Software\PBE\QOwnNotes\darkModeColors" are read 72 times.
Filtered on successfull events of this one registry key:
Steps to reproduce
en-us_windows_11_consumer_editions_version_23h2_updated_april_2024_x64_dvd_d986680b.iso
@2x
is covered in [BUG] Freezes and "Not responding" when reloading script engine on Windows #3024Output from the debug section in the settings dialog
Expand
QOwnNotes Debug Information
General Info
Current Date:
Fri May 10 11:36:38 2024
Version:
24.5.1
Build date:
May 5 2024
Build number:
1097
Platform:
windows (windows)
Operating System:
Windows 10 Version 2009
Build architecture:
x86_64
Current architecture:
x86_64
Release:
GitHub Actions
Qt Version (build):
5.15.2
Qt Version (runtime):
5.15.2
Portable mode:
no
Settings path / key:
\HKEY_CURRENT_USER\Software\PBE\QOwnNotes
Application database path:
C:\Users\localuser\AppData\Roaming\PBE\QOwnNotes\QOwnNotes.sqlite
Application arguments:
C:\Users\localuser\Desktop\QOwnNotes\QOwnNotes.exe
Qt Debug:
0
Locale (system):
en_US
Locale (interface): empty
Primary screen resolution:
1024x576
Icon theme:
breeze-dark-qownnotes
Notes in current note folder:
2
Calendar items:
0
Enabled scripts:
0
Database drivers:
QSQLITE, QODBC, QODBC3, QPSQL, QPSQL7
Server Info
serverUrl: empty
appIsValid:
yes
notesPathExists: empty
serverVersion: empty
appVersion: empty
Spellchecking
Enabled:
false
Selected language: empty
Language codes: empty
Language names: empty
Application dictionaries path:
C:\Users\localuser\AppData\Roaming\PBE\QOwnNotes\dicts
Note folders
currentNoteFolderId:
1
Note folder
default
id:
1
isCurrent:
yes
activeTagId:
0
localPath:
C:\Users\localuser\Notes
remotePath:
Notes
cloudConnectionId:
1
isShowSubfolders:
no
isUseGit:
no
allowDifferentNoteFileName:
no
activeNoteSubFolder name: empty
database file:
C:\Users\localuser\Notes\notes.sqlite
Cloud connections
Cloud connection
Default
id:
1
isCurrent:
yes
serverUrl: empty
username: empty
accountId: empty
Enabled scripts
Settings
ActiveNoteHistoryItem (NoteHistoryItem):
<binary data>
Editor/CurrentSchemaKey (QString):
EditorColorSchema-cdbf28fc-1ddc-4d13-bb21-6a4043316a2f
Editor/removeTrailingSpaces (QString):
false
LastUpdateCheck (QDateTime):
2024-05-10T11:36:32.927
MainWindow/geometry (QByteArray):
<binary data>
MainWindow/mainToolBar.iconSize (int):
24
MainWindow/menuBarGeometry (QByteArray):
<binary data>
MainWindow/noteTextEdit.code.font (QString):
Courier New,9,-1,2,50,0,0,0,0,0
MainWindow/noteTextEdit.font (QString):
MS Shell Dlg 2,8.25,-1,5,50,0,0,0,0,0
MainWindow/noteTextView.code.font (QString):
Courier New,9,-1,2,50,0,0,0,0,0
MainWindow/noteTextView.font (QString):
MS Shell Dlg 2,8.25,-1,5,50,0,0,0,0,0
NoteFolder-1/NoteTabNameList (QStringList):
Markdown Cheatsheet
NoteFolder-1/NoteTabStickinessList (QStringList): empty
NoteFolder-1/NoteTabSubFolderPathDataList (QStringList): empty
NoteHistory-1 (QVariantList):
<variant list with 2 item(s)>
NoteHistoryCurrentIndex-1 (int):
1
PiwikClientId (QString):
<hidden>
SettingsDialog/geometry (QByteArray):
<binary data>
SettingsDialog/mainSplitterState (QByteArray):
<binary data>
WelcomeDialog/geometry (QByteArray):
<binary data>
allowNoteEditing (QString):
true
allowOnlyOneAppInstance (QString):
true
appMetrics/notificationShown (QString):
true
checkSpelling (QString):
false
cryptoKey (qlonglong):
<hidden>
currentNoteFolderId (int):
1
currentWorkspace (QString):
initial
darkMode (QString):
true
darkModeColors (QString):
true
darkModeIconTheme (QString):
true
darkModeTrayIcon (QString):
true
demoNotesCreated (QString):
true
disableAutomaticUpdateDialog (QString):
true
dockWasInitializedOnce (QString):
true
guiFirstRunInit (QString):
true
initialLayoutIdentifier (QString):
minimal
itemHeight (int):
15
markdownHighlightingEnabled (QString):
true
noteEditIsCentralWidget (QString):
true
noteFileExtensionList (QStringList):
md, txt
notesPath (QString):
C:/Users/localuser/Notes
ownCloud/supportEnabled (QString):
false
ownCloudInfo/appIsValid (QString):
true
ownCloudInfo/connectionErrorMessage (QString): empty
ownCloudInfo/notesPathExistsText (QString): empty
ownCloudInfo/serverVersion (QString): empty
showMenuBar (QString):
true
showStatusBar (QString):
true
webAppClientService/token (QString):
<hidden>
workspace-initial/name (QString):
Minimal
workspace-initial/noteSubFolderDockWidgetVisible (QString):
true
workspace-initial/windowState (QByteArray):
<binary data>
workspaces (QStringList):
initial
System environment
ALLUSERSPROFILE:
C:\ProgramData
APPDATA:
C:\Users\localuser\AppData\Roaming
CommonProgramFiles:
C:\Program Files\Common Files
CommonProgramFiles(x86):
C:\Program Files (x86)\Common Files
CommonProgramW6432:
C:\Program Files\Common Files
COMPUTERNAME:
W1123H2
ComSpec:
C:\Windows\system32\cmd.exe
DriverData:
C:\Windows\System32\Drivers\DriverData
EFC_5264:
1
FPS_BROWSER_APP_PROFILE_STRING:
Internet Explorer
FPS_BROWSER_USER_PROFILE_STRING:
Default
HOMEDRIVE:
C:
HOMEPATH:
\Users\localuser
LOCALAPPDATA:
C:\Users\localuser\AppData\Local
LOGONSERVER:
\\W1123H2
NUMBER_OF_PROCESSORS:
8
OneDrive:
C:\Users\localuser\OneDrive
OS:
Windows_NT
Path:
C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0\;C:\Windows\System32\OpenSSH\;C:\Users\localuser\AppData\Local\Microsoft\WindowsApps;
PATHEXT:
.COM;.EXE;.BAT;.CMD;.VBS;.VBE;.JS;.JSE;.WSF;.WSH;.MSC
PROCESSOR_ARCHITECTURE:
AMD64
PROCESSOR_IDENTIFIER:
Intel64 Family 6 Model 154 Stepping 3, GenuineIntel
PROCESSOR_LEVEL:
6
PROCESSOR_REVISION:
9a03
ProgramData:
C:\ProgramData
ProgramFiles:
C:\Program Files
ProgramFiles(x86):
C:\Program Files (x86)
ProgramW6432:
C:\Program Files
PSModulePath:
C:\Program Files\WindowsPowerShell\Modules;C:\Windows\system32\WindowsPowerShell\v1.0\Modules
PUBLIC:
C:\Users\Public
SESSIONNAME:
Console
SystemDrive:
C:
SystemRoot:
C:\Windows
TEMP:
C:\Users\LOCALU~1\AppData\Local\Temp
TMP:
C:\Users\LOCALU~1\AppData\Local\Temp
USERDOMAIN:
w1123h2
USERDOMAIN_ROAMINGPROFILE:
w1123h2
USERNAME:
localuser
USERPROFILE:
C:\Users\localuser
windir:
C:\Windows
Relevant log output in the Log panel
With all categories enabled.
Relevant resources
The text was updated successfully, but these errors were encountered: