When displaying any kind of table, Panorama X uses an Apple class called NSTableView. This is used by the data sheet, Text Lists, Matrixes, etc. NSTableView is also used by many other programs, for example the Finder uses it to display files. It’s a workhorse of the Cocoa API’s.
Apple has gone to great lengths to optimize the performance of NSTableView for large numbers of rows. If programmed correctly, it is amazingly fast even with hundreds of thousands of rows.
However, Apple apparently did not put much work into optimizing performance for large numbers of columns – especially when adding or removing columns. Once you get past 50 columns, it starts slowing down significantly. Apple apparently doesn’t care, I don’t think they have any applications where more than 8-10 columns appear in a table.
Perhaps at some point I’ll have to write my own version of NSTableView from scratch. However, there are significant drawbacks to that idea: 1) It would probably take six months or more, 2) it would be difficult to optimize the performance with large number of rows to the degree that Apple has done, 3) It would be difficult to get the UI to exactly match Apple’s, especially as new versions of macOS come out, 4) any such large project would undoubtably have a significant number of new bugs. Bottom line, this is not a project that will be done in the near future, if ever.
So for best performance now, I would recommend keeping the data sheet to no more than about 50 visible fields. If your database has significantly more fields than that, I would set up configurations of favorite fields with no more than 50 fields, and then switching to the configuration of fields you want to see at any particular time.
That said, the performance problems are mostly related to changing the field configuration, adding and removing fields. So I’m wondering if that is happening in your example. The
importtext statement will automatically add new fields as necessary if the imported text contains more fields than the database already has. So perhaps this is happening and that is causing a big slowdown. You might try using the
"addfieds","no" option and see if that makes it faster – if so, you might want to make sure to add the fields you need in advance, rather than letting the import do it.
Another option to try would be to simply close the data sheet, leaving just your form with one object.