How speed up GTK2? lazarus / 1-Linux ---------------------------------------------------------------------- clauslack · 2009-12-10 20:46 Hi GTK2 is slower than (GTK/WIN32). I download the last snapshop of Lazarus(0.9.28.3-23052), but is slow too.(with GTK2 2.12.12) Anyone know some tip for speed up GTK2? Thanks. ---------------------------------------------------------------------- clauslack · 2009-12-11 19:23 I found the bottleneck under GTK2, is the DBGrid. But is strange. I have 2 querys in 2 diferent procedure. (take 97% of CPU-kernel 2.6-celeron 1.8 GHZ-256 RAM) query1 <-> DBEdit = 3.9 sec. query2 <-> DBGrid = 3.9 sec. but if clear DBGrid.datasource (query2 still run) query1 <-> DBEdit = 0.8 sec. query2 without DBGrid = 0.5 sec. under Windows this querys take less 1 second, under GTK2, 8 seconds!!! I test with 0.9.28.3 svn 23052. Any idea? Thanks ---------------------------------------------------------------------- Leledumbo · 2009-12-14 09:32 AFAIR, GTK2 doesn't implement the BeginUpdate and EndUpdate of TStrings. That's what makes it sllllooow... I have no idea whether it can be implemented or not, just see the corresponding source file (find stringlist related unit under lcl/gtk2). ---------------------------------------------------------------------- clauslack · 2009-12-14 12:45 I had a mistake in my code I fix and retest with DBGrid1.DataSource:=Datasource2; Under Windows (Celeron 733 MHZ-256 RAM) 0.60 seconds Under Linux GTK2 (Celeron 1.8 GHZ-256 RAM) 3.69 seconds If run the Query with empty DBGrid1.DataSource under linux the time is 0.7 seconds. Seems that fill the DBGrid under GTK2 is slower than Windows. QuoteAFAIR, GTK2 doesn't implement the BeginUpdate and EndUpdate of TStringsTStrings is the problem?? Thanks ---------------------------------------------------------------------- theo · 2009-12-14 13:15 Afaik GTK2 speed may also depend on the system/drivers and installed library versions. See: http://wiki.lazarus.freepascal.org/GTK2_Interface#Synedit_is_very_slow ---------------------------------------------------------------------- jesusr · 2009-12-15 20:55 what dataset are you using (ie, what database)? what dataset/datasource events are being used? have you tried dataset.disablecontrols; dataset.open; dataset.enablecontrols;? ---------------------------------------------------------------------- clauslack · 2009-12-15 21:28 Quotewhat dataset are you using (ie, what database)?IBConnection - remote Firebird 2.1.2 - Lazarus 0.9.28.3 svn 23502 fpc 2.2.4 - GTK2 2.12.12 Quotewhat dataset/datasource events are being used?Just Open Quotehave you tried dataset.disablecontrols; dataset.open; dataset.enablecontrols;?Yes, I do it. Is the same code, in linux is 3 seconds more slow than windows. (there are 4 querys) In general GTK2 is a second more slow than windows in the same hardware. - compiled the app. for pentium3. - recompiled the kernel 2.6 optimized for pentium3. - Turn on DRI in xorg.conf (test with glxgears, is faster) - Add more BIOS VGA shared memory. But still is slower than windows. But if clear DBGrid.datasource (query2 still run), is faster like Windows. I will try reproduce it in a new project. Regards