You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
# GoldenDict-ng Startup Performance Optimization Record
2
+
3
+
## 1. Optimization Goal
4
+
Reduce interface stuttering during cold start, shorten the perceived time from clicking to displaying the main window, and lower the CPU and disk I/O peaks during the startup phase.
Decouple non-critical tasks from the `MainWindow` constructor and synchronous initialization flow. Utilize `QTimer::singleShot` to trigger these tasks in stages after the main event loop starts, achieving a "progressive startup."
|**ArticleInspector (Debugger)**| Sync creation in constructor |**Lazy creation**| Instantiated only when "Inspect Element" is triggered |
14
+
|**ScanPopup (Scan Progress)**| Sync trigger in constructor |**Delayed 1,000ms**| Avoids QWebEngine loading blocking main window display |
15
+
|**TrayIcon**| Sync init in constructor |**Delayed 1,000ms**| Reduces synchronous communication with system shell |
16
+
|**GlobalHotkeys**| Sync installation in constructor |**Delayed 2,000ms**| Moves system-level hotkey registration to background |
17
+
|**doDeferredInit (Deep Init)**| Sync execution at end of constructor |**Delayed 3,000ms**| Avoids peak I/O for file handles and abbreviation loading |
18
+
|**FullTextSearch (FTS Indexing)**| Sync start in `makeDictionaries`|**Delayed 5,000ms**| Ensures UI is idle before starting large-scale disk scanning |
19
+
|**New Release Check**| Immediate execution (0ms) |**Delayed 10,000ms**| Moves network requests and JSON parsing after stability |
For the `doDeferredInit` delay, existing dictionary class implementations (e.g., `DslDictionary`, `MdxDictionary`) already include `ensureInitDone()` protection logic.
25
+
-**Safety**: If a user performs a lookup or FTS search before the delay (3s) expires, the code will automatically trigger synchronous initialization, ensuring no loss of functionality.
26
+
-**Experience**: The delay is only to release system resources and does not cause functional deadlocks.
27
+
28
+
### 4.2 UI Responsiveness Priority
29
+
By delaying `ScanPopup` and `ArticleInspector` (both WebEngine-driven), we significantly reduce the peak frequency of VRAM and RAM allocation, allowing the main viewport (`ArticleView`) to complete its first-paint at the highest priority.
30
+
31
+
## 5. Expected Results
32
+
-**Perceived Speedup**: Main window display speed improved by 30% - 50%.
33
+
-**I/O Peak Shaving**: Smooths the disk I/O "spike" from massive dictionary loading into a sustained "low-load" process over several seconds.
34
+
-**Stability**: Reduces the probability of thread deadlocks or UI freezes caused by resource contention during critical startup moments.
<source>Open website dictionary in separate tab</source>
3504
+
<translation>فتح قاموس الموقع في علامة تبويب منفصلة</translation>
3505
+
</message>
3526
3506
</context>
3527
3507
<context>
3528
3508
<name>ProgramTypeEditor</name>
@@ -3705,7 +3685,7 @@ from Stardict, Babylon and GLS dictionaries</source>
3705
3685
</message>
3706
3686
<message>
3707
3687
<source>Can't save article: %1</source>
3708
-
<translationtype="unfinished">Can't save article: %1</translation>
3688
+
<translation>تعذّر حفظ المقالة: %1</translation>
3709
3689
</message>
3710
3690
<message>
3711
3691
<source>Save PDF complete</source>
@@ -3774,6 +3754,10 @@ from Stardict, Babylon and GLS dictionaries</source>
3774
3754
<source>WARNING: %1</source>
3775
3755
<translation>تحذير: %1</translation>
3776
3756
</message>
3757
+
<message>
3758
+
<source>Definition</source>
3759
+
<translation>التعريف</translation>
3760
+
</message>
3777
3761
</context>
3778
3762
<context>
3779
3763
<name>ScanPopupToolBar</name>
@@ -4250,6 +4234,10 @@ Full list of availiable languages can be found <a href="https://linguali
4250
4234
<source>Only available when opening websites in separate tabs. Can be a file path (relative to config directory or absolute) or direct script content.</source>
4251
4235
<translation>متاح فقط عند فتح المواقع في علامات تبويب منفصلة. يمكن أن يكون مسار الملف (نسبة إلى مجلد التكوين أو مطلق) أو محتوى البرنامج النصي المباشر.</translation>
4252
4236
</message>
4237
+
<message>
4238
+
<source>This column is disabled because "Open website dictionary in separate tab" option is not enabled in Preferences.</source>
4239
+
<translation>هذا العمود معطل لأن "فتح قاموس الموقع في علامة تبويب منفصلة" لم يتم تمكينه في التفضيلات.</translation>
0 commit comments