Iterating over a list to produce a report containing control breaks

Hi,

I wonder if anyone has any suggestions for improving the performance of a report page I have created, which displays a list of data grouped at various control breaks:

The idea is straightforward. The page displays information for a financial adviser who wishes to view investments held by his/her clients. The information is grouped at the level of Fund, Client and Fund Type, with the detail line representing the individual investment in the investee company. As you can probably guess this functionality is implemented using nested repeating groups which derive their data from the input parameter to the page, which is a disposable custom thing , designed specifically for the page. The thing looks like:

The thing _Fmt_Page_0 is populated with information from a database table called Investments , which is already sorted into the correct sequence. Each Investment from the Investment table corresponds to a detail line of the _Fmt_Page_0 thing above. _Fmt_Page_0 is populated by triggering an API workflow which runs asynchronously in the background, setting a flag once it has completed. The act of setting the flag triggers the display of the page shown earlier.

image

The functioning of the API workflow is best described using some pseudo-code. Iteration is achieved by having an API Workflow which calls itself recursively:

API workflow showing how it calls itself (step 16 in diagram below):

image

From a functional point of view, all this works fine, but the problem is that the API workflow takes 3 mins 40 secs to complete even when capacity has been boosted.

Does anyone have any suggestions as to how it could be speeded up?

1 Like

Potentially the API workflow could create records faster, if you can identify streams that can be created in parallel, but each create is going to be the same speed.

An alternative is to store the data structure in a “packed” form, as a text in one record. Then unpack it on the page. Advantage is less database interaction, i.e. speedier. Disadvantages are many, including complexity, harder to search/filter, etc. But for a report that may be okay, plus you could do both, and not wait for the structured form to be complete.

Two examples of packed forms are delimited texts and JSON.

1 Like

Hi Mishav, many thanks for your reply. I’ll look into these alternatives.