saulgreenberg / TimelapseDeprecatedPre2.3

Timelapse Image Analysis Tool
Other
1 stars 0 forks source link

Editor: Improve performance of SyncTemplateTableToDatabase #2

Closed saulgreenberg closed 7 years ago

saulgreenberg commented 7 years ago

Causes very slow updates when new rows are added, and when repositioning controls in UI or in spreadsheet.

saulgreenberg commented 7 years ago

See Adding a new row, and redordering items in controls or spreadsheet.

AddControlButton_Click invokes: this.OnControlOrderChanged();-> UpdateDisplayOrder ->SyncTempateTable ToDatabasewhich

SyncTempateTable ToDatabase deletes all the rows in db and then readds all rows. I think this is the bottleneck.

saulgreenberg commented 7 years ago

Resolved by several methods. It is now significantly faster. While additional performance tweaks can be done, it may not be worth the effort as it is now fast from a UI perspective.

In particular: For AddControlButton, created a new method that just updates all control and spreadsheet order values For Reordering controls and spreadsheets, fixed it so that it no longer performs multiple database updates for each and every row.