Users of HeidiSQL are experiencing slowness when HeidiSQL adds more than ~1000 strings to a TSynSQLSyn.TableNames. On my Core I7 4500U CPU, 1000 strings need roughly 1 second. A normal TStringList would work much faster, but SynEdit does something in the back with this list, which makes it so slow.
It also does not seem to have an effect if I wrap that in a BeginUpdate/EndUpdate block.
See the latest report from a user: http://www.heidisql.com/forum.php?t=18945#p21272
I noticed this bug yesterday. My solution was to build the list in the temporary stringlist and assign the complete list to the highlighter. Most probably the reason for the slowdown is the TSynSQLSyn.TableNamesChanged.
Maybe we should add BeginTableNamesUpdate/EndTableNameUpdates.
I already wrapped the TableNames assignment in a Begin/EndUpdate block. Still, one update of that list is still slow.
I did some debugging and found out that it is TSynSQLSyn.PutTableNamesInKeywordList which is slow. Took ~15 seconds for 10,000 table names. To verify that I'm only once in PutTableNamesInKeywordList() I added a showmessage() there, which showed up once, so I'm very sure it's executed one time, not one time per item.
Only, in PutTableNamesInKeywordList() I see some HashKey logic of which know nothing about. Would be nice if someone could speed that procedure up for large amounts of table names.
Fix for #28: Use TDictionary<Key, Value> for D2009 and newer to incre…
…ase the performance for adding a lot of table names
the used hash table with a 8-bit bucket size seems not designed for thousands of entries
The used hash table with a 8-bit bucket size seems not designed for thousands of entries. I have committed a fix that uses TDictionary<Key, Value> for D2009 and newer to increase the performance.
Looks very promising! Thanks so far.
I just merged the updated code in HeidiSQL so I get feedback from relevant users.
Got positive feedback (along with more negative comments about totally unrelated stuff) here and here
Thanks a lot for fixing this. Was a long-time bug in Heidi, before I reported that here.
Merge latest changes from official SynEdit repository. Fixes slow hig…
…hlighter when TableNames contains several 1000's of strings. Removes limitation to 1000 table names for highlighting. See
git-svn-id: http://svn.code.sf.net/p/heidisql/code/trunk@5111 40cadd2d-89a2-4482-8f20-0232d845d7e3