jimevins / glabels

gLabels Label Designer
http://glabels.org
GNU General Public License v3.0
66 stars 25 forks source link

Slow (14s) loading time #66

Open dennisnez opened 4 years ago

dennisnez commented 4 years ago

After upgrading from glabels-2 to glabels-3(.4.1) I immediately painfully noticed a muuch longer time to start the app - 14 seconds! 14 seconds of nothing appearing on screen, cpu at 100%, on my 1.6ghz machine.

Getting rid of the main culprits, lgl_db_init() and gl_mini_preview_pixbuf_cache_init() cut that down to 7 seconds and didn't seem to cause any obvious issues (yet). Are these functions needed? And can the loadtime be made faster than 7 seconds here? :p

--- glabels-3.4.1/src/glabels.c 2016-01-23 21:06:18.000000000 -0500
+++ ./glabels.c 2020-07-22 09:16:13.000000000 -0400
@@ -104,9 +104,7 @@

    /* Initialize subsystems */
    gl_debug_init ();
-   lgl_db_init ();
    gl_prefs_init ();
-   gl_mini_preview_pixbuf_cache_init ();
    gl_merge_init ();
    gl_recent_init ();
         gl_template_history_init ();
sur5r commented 4 years ago

The main issue is parsing of the template files which most probably happens somewhere in lgl_db_init(). For testing purposes, I once combined all template XMLs into a single file which reduced startup time a lot. I never got around to dig deeper, though.