My scenario is this: In one module of my application, my end user creates the templates for various Builder models which are later selected for application to each job started for that model to track progress. Each template is created using a hierarchical file structure like: Model Options Tasks Task Details
So each Model may have 5 or more Options, each Option may have 10+ Tasks, each Task may have 10+ Task Detail records: 550+ record inserts to an on premise SQL database. It’s a time consuming process for manual entry. Some of the larger Builders’ models are fairly similar, but need size/option specs modified. So for purposes of setup and future Builder models, I created a ‘Duplicate Model’ function. The basic logic for it is: 1. Collect “Master Model” template Options/Tasks/Details into Collections 2. Enter New Model # & Name 3. Patch Options/Tasks/Details to on premise SQL tables 4. Make necessary edits to conform to new Builder model
Well, it’s faster than manual entry, but it is up to a minute wait time for the end user – an opportunity to practice Mindfulness, but usually just a point of frustration.
In lieu of trying to re-train my end users to go the Mindfulness route, I have overlapped some of the slow collects and patches to make the wait time a little less irritating.
I have a button to select the Duplicate Function which now fires off a concurrent Collect for the 3 tables involved and opens a dialogue box for the user to enter new Model # & Name. The confirmation button does not go visible until after the concurrent action is complete. When they confirm, it begins patching the SQL tables for Options/Tasks, but it clears the dialogue box and brings them back to the Builder Model screen before it starts the most time consuming patch to the Task Detail table. By the time they get down to the level of editing the Task Detail for the Model Template, the Details have been patched.
I have gone through the lists and found others that bump up against this, and some solutions using stored procedures and flow, but I guess I was looking for some way to not get too complicated partly due to my lack of experience in those areas.
Actually, the Collect function would have better performance than Patch function in execution. You could consider open the Developer Tools in your browser, then check the execution performance between Collect function and Patch function.
Note: You can quickly measure your app’s performance by turning on Developer Tools in Microsoft Edge or Google Chrome while running the app.
In addition, there are many reasons that an app can be slow to load, slow to respond, and slow to write to data sources. Please check the following blog for more details: