Trouble with VirtualTreeView: painting rows into the data grid is very slowly!

[expired user #4964]'s profile image [expired user #4964] posted 14 years ago in General Permalink
Hello,

HeidiSQL 3299 and above has a bug in painting rows into the data grid. The lines were painted very slowly.

Select a table and press the "Show All" Button. The Table should store more than 50.000 items. Scroll the grid and see the effects.


PS: I hate the google issue tracker. ;-)
And does not want to register.
ansgar's profile image ansgar posted 14 years ago Permalink
Works perfectly here, cannot reproduce that.
ansgar's profile image ansgar posted 14 years ago Permalink
Oh, now I see it. Probably had not enough columns the first time to make it slow. No problem in VT btw, more obviously something in mysql_connection.pas - probably something causes mysql_data_seek too often (which is incredibly slow!). Will check that.
Code modification/commit from ansgar.becker, 14 years ago, revision 5.1.0.3392
Make grid scrolling incredibly much faster, by exiting early in SetRecNo if current row is already the right one. See http://www.heidisql.com/forum.php?t=5890
ansgar's profile image ansgar posted 14 years ago Permalink
I just found and fixed the performance killer - r3392 is incredibly much faster now in grid scrolling.
ansgar's profile image ansgar posted 14 years ago Permalink
Just if you are curious what this one liner in r3392 fixes:

A grid in HeidiSQL calls Data.SetRecNo at least 3 times to paint one cell, its text and its color. E.g. if you have 10 columns in a grid - makes 30 calls to SetRecNo to get one single row painted. Imagine there are 20 rows displayed at once, makes 600 calls. Pretty normal up to here.

Now, SetRecNo is the place where mysql_data_seek() is called. mysql_data_seek() is very slow in general, and even slower for a row offset of several thousands in a result. 30 calls to mysql_data_seek() per row caused the slowness here.

Now, the above mentioned change exits SetRecNo before calling mysql_data_seek, if the cursor is already at the right row. Means, we have 1 instead of 30 calls to mysql_data_seek - which is of course faster.
ansgar's profile image ansgar posted 14 years ago Permalink
It's a mess. r3392 causes a new problem in Heidi's data tab, when switching between tables via left tree. Reported in issue #2009. Sigh...
[expired user #4964]'s profile image [expired user #4964] posted 14 years ago Permalink
Hi,

the build 5.1.3443 looks great and works fine here.
Thank you for fixing the bugs. :)

Please login to leave a reply, or register at first.