Closed o-l-a-v closed 4 months ago
This happens when simply opening "Settings" too. It takes about 5 seconds. The only log output is the following:
[09:11:56] [debug] cloudConnection: CloudConnection: <id>1 <name>"Default" <serverUrl>"" <username>"" <accountId>"" <priority>1
procmon spams the same lines as the first screenshot shows.
If theres anything else I can do to provide debug info; tell me and I'll try to provide it. 😊
You didn't share your settings, hard to get a closer look... Can you please post the output from the Debug settings in the settings dialog?
So you ran QOwnNotes from a folder QOwnNotes
on your desktop? What's that file (or folder) it wants to create? @2x
looks like an image upscaling CSS attribute... How does your notes look?
Does the same happen with only the welcome notes and another script from the script repository?
As described in the original issue: This is a clean ZIP from GitHub releases, only change I made was to add that local script and set theme to Dracula. That's it.
Notes are just the standard ones supplied by QOwnNotes when creating a new note folder.
Heres the output of debug.
I created a clean Hyper-V VM from Microsoft official ISO en-us_windows_11_consumer_editions_version_23h2_updated_april_2024_x64_dvd_d986680b.iso
. Chose Windows 11 Pro. Created a local user, then all I did was installing Windows Updates and reboot.
Then:
I don't see the same pattern in Process Monitor, but I see something that looks like telemetry that seemingly takes 2-3 seconds?
Output of debug:
I disabled heartbeat and telemtry in settings -> Network. Closed QOwnNotes. Opened QOwnNotes. Scripting -> Script settings -> Reload script engine. Shows the same behavior as when I tested portable mode on my physical machine earlier. Freezes for around 20 seconds maybe. And process monitor is spammed with the same "@2x" thing.
Now debug looks like this:
It happens even if no scripts are enabled, only that QOwnNotes seems to freeze for a shorter time. 5-10 seconds. And not consistently. And with same output in process monitor.
I tried it out on my Windows 11 installation.
cd C:\Program Files\QOwnNotes
and QOwnNotes.exe --portable
I got 0 lag, I could interact with the application all the time. 🤷🏻
Did turning off metric change anything? The network requests are supposed to run in the background anyway...
Strange. 🤔 Maybe it has to do with scaling and resolution? I have three monitors:
But that wouldn't neccessarily explain why it also happened inside the VM, hmm..
Turning of metrics made it worse, but I don't know if it was due to turning metrics off or closing QOwnNotes after its' first ever run then reopening it. The spamming in procmon for creating file @2x
wasn't there before the second run.
I have a Pop!_OS VM too. With the Flatpak version, enabling (ticking the checkbox) for "Black mode" from Settings -> Scripting easily takes 5-10 seconds. So does reloading script engine.
Same with the Snap version.
Disabling heartbeat and tracking does not seem to make a difference.
I had a 4K screen and an HD screen attached too... No idea. I've never seen such an issue...
Seems it could have something to do with Qt and scaling?
Qt documentation on QImageReader states that
The high resolution version is marked by the suffix @2x on the base name. The image read will have its device pixel ratio set to a value of 2.
Good question, but in QOwnNotes QML is not used for UI, just for script support... And I also tested on a High DPI screen... 🤔
Seems it has something to do with scaling after all. I tried disabling "QT_AUTO_SCREEN_SCALE_FACTOR" with PowerShell:
[System.Environment]::SetEnvironmentVariable(
'QT_AUTO_SCREEN_SCALE_FACTOR',
0,
'User'
)
Started QOwnNotes, tried reloading script enginge. It freezes for much shorter (still freezes though), and I can no longer see that spamming in procmon about @2x
.
I wonder where QT_AUTO_SCREEN_SCALE_FACTOR
got set? I can't see it in your ENV dump...
But what I do see is QML_DISABLE_DISK_CACHE: true
. I'm currently under NixOS, don't have that set here...
Maybe try turning that to false?
I think QT_AUTO_SCREEN_SCALE_FACTOR
defaults to true if not set? Maybe QML_DISABLE_DISK_CACHE
defaults to false on Windows for some reason?
Tried setting QML_DISABLE_DISK_CACHE
to 0. It did not exist as an env variable before I did. Hard to measure whether it has an impact on performance. Opening settings still spams the Windows registry 72 times for a single registry key, ref #3027.
I think QT_AUTO_SCREEN_SCALE_FACTOR defaults to true if not set?
For me, under NixOS, it's 0.
Maybe QML_DISABLE_DISK_CACHE defaults to false on Windows for some reason?
Dunno, it was true for you. ️🤷🏻
Opening settings still spams the Windows registry 72 times for a single registry key, ref https://github.com/pbek/QOwnNotes/issues/3027.
And you sure that causes a 20sec lag? (see #3027).
Dunno, it was true for you. ️🤷🏻
It was not set in the registry, so I don't know were it came from.
And you sure that causes a 20sec lag? (see https://github.com/pbek/QOwnNotes/issues/3027).
Yep. 15-20 seconds. Note theres a difference between:
Guess I'll do some more testing on that vanilla Windows installation.
QT_AUTO_SCREEN_SCALE_FACTOR
enabled vs. disabled.QML_DISABLE_DISK_CACHE
enabled vs. disabled.Findings:
QML_DISABLE_DISK_CACHE
is set to false when QOwnNotes.exe --portable
.A debug build will probably be the next step in troubleshooting here, yep.
This issue is stale because it has been open for 30 days with no activity.
This issue was closed because it has been inactive for 14 days since being marked as stale.
Expected behaviour
Reloading script engine with one simple script that only set some colors should be almost instant.
Script in question, but I don't think the script in itself matters:
Click to view
```qml import QtQml 2.0 QtObject { function init() { script.addStyleSheet( "QWidget { /*background-color: #191A21;*/ selection-background-color: #44475A; selection-color: #F8F8F2; }" ); script.addStyleSheet( "QListView:focus { color: #F8F8F2 }" ); script.addStyleSheet( "QWidget:item:selected { background-color: #44475A; color: #F8F8F2; }" ); script.addStyleSheet( "QLineEdit, QLineEdit:active { background-color: #282A36; color: #F8F8F2; }" ); script.addStyleSheet( "QMarkdownTextEdit { background: #282A36; }" ) script.addStyleSheet( "QListView, QTableView, QTreeView { background: #282A36; }" ); script.addStyleSheet( "QListView::item:pressed, QTableView::item:pressed, QTreeView::item:pressed { background: #44475A; color: #F8F8F2; }" ); script.addStyleSheet( "QListView::item:selected:active, QTableView::item:selected:active, QTreeView::item:selected:active { background: #44475A; color: #F8F8F2; }" ); script.addStyleSheet( "QListView::item:selected:hover, QTableView::item:selected:hover, QTreeView::item:selected:hover { background: #44475A; color: #F8F8F2; }" ); } } ```Actual behaviour
QOwnNotes freezes for many seconds and becomes "Not responding".
Steps to reproduce
qownnotes --portable
Output from the debug section in the settings dialog
Almost no changes from a newly downloaded QOwnNotes, running with
--portable
.Relevant log output in the Log panel
I enabled all log categories. Here are the output of doing it from Scripting -> Reload script engine.
Expand
``` [09:02:46] [scripting] loading script file: C:/Users/olav.birkeland/Desktop/QOwnNotes/Data/scripts/QOwnNotes-Script-Theme_text_highlighting.qml [09:02:50] [status] The scripting engine was reloaded ```Microsoft Process Monitor
As QOwnNotes didn't produce much info on what's happening here I looked for other ways to get info. I fired up Microsoft Process Monitor / procmon ( https://learn.microsoft.com/en-us/sysinternals/downloads/procmon ). When reloading script engine procmon fills up with this (tens of thousands of lines):
And some registry access in between once in a while: