Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.Sign up
TSynSQLSyn.TableNames slow when adding new strings #28
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.