Use Profiling to Optimize Calculation Paths in your Application

  • 14 June 2024
  • 0 replies
  • 225 views

Userlevel 4
Badge +3

A key element in optimizing model performance is understanding how specific updates and their calculation paths can affect your model. For example, you might have important actions you want to ensure are being calculated efficiently by your model and you have built your model such that important blocks are being computed as quickly as possible. In Pigment, you can profile these actions and calculation paths resulting from specific updates applied to your model.

Profiling calculation paths helps you understand the parts in your model that are slow to calculate following a specific user action. You can identify which Blocks in the calculation path take the longest to execute and which formulas need optimization. Profiling directs you in adjusting your model to ensure the calculation paths deliver better performance times and eliminate model constraints.

When you profile an action, you’re profiling the calculation path for the model at the time of the update. It’s worth remembering that if the model has changed a lot, or if many objects have been deleted, these won’t be available in the profile. In this case, it’s worth either doing a new action so you can profile the most recent state of the model, or navigating to the dependency diagram within the profile to view the latest dependencies compared to at the time of the profile. 

Before you begin

Prerequisite information

  • Permissions. You need to have the Builder Account Type or above to view the calculation path from a specific update in an Application. 
  • Time period. Updates in an Application are available for profiling for three days. After three days, profiling on these updates are unavailable.
  • Scenarios. If you’re using Scenarios in the Application you’re profiling, you may see multiple rows of the same Metric. Computations are executed based on the Scenario used in the Metric, so the model calculates according to the formula groups used in the Metric. Read more about formula groups in Scenarios in Editing formulas within Scenarios.
    Scenario information is only available for Metrics on the current Application, not on Metrics coming from other Applications.
  • Access Rights and Permissions. If you see that an object is “not found”, this is likely an access issue, that is, you don’t have access to the object. Also, the object could have been deleted, or there was a technical error in loading the object.

Prerequisite tasks

We recommend that you have a good understanding of Pigment performance optimization. These topics can get you started: 

You also require a good understanding of formula scoping

Profile an Update

  1. To profile an update from an Application:
    a. Open your Application. 
    b. Click the History button located in the Sidebar. 
    c. Locate and hover over the update you want to profile, and then click Profile update.
    This opens the calculation path for this update. 
     
  2. To profile an update from a specific Block: 
    a. In your Board, expand the specific Block you want to profile. 
    b. Click the Block updates icon. 
    c. Locate and hover over the update you want to profile, and then click the menu (...).
    This opens the calculation path for this update. 
       

     

Profiling Data 

When you profile a specific update, the following Profiling pane opens and displays the total time and number of Blocks that were revised as a result of the action. you are profiling: 

 

You can use the following actions and information to assess your calculation path and model performance: 

  • Sorting and Filtering. By default, all calculated objects in the Profiling pane are displayed in Chronological order of calculation. 
    • Filter on the path to this object displays a filtered view of the calculation path with objects calculated on the path to the selected object. The filtered view displays the path of all objects computed as a result of the action to the selected object, which would be objects linked through formula references as well as objects linked through computational dependencies leading to the selected object.
    • Sort by Computation Duration: Besides the Chronological default sorting, you can also sort on Computation Duration, which will sort all the objects in the pane in descending order from the highest Computation Duration (the objects with the longest execution time) to lowest. This allows you to quickly view the objects that were slowest to execute in order.
    • Filter by Scenario: If you have the Scenarios feature activated within your application, you can click on the specific Scenario to filter on blocks by that Scenario. Blocks that do not have scenarios applied (e.g. Transaction Lists or Dimension Lists) will still appear on the list.
  • Dependency Lists. Hovering over a Block to display a list of objects, such as Blocks or List properties, that are linked through formula references on the path to the selected object.
  • Scheduling and Execution Times.
    • Scheduled at and Executed at times are visible when you hover over specific calculated items. 
    • A grey bar indicates the amount of time between a calculation being scheduled and the model being executed. This is time difference is due to the model executing other required technical computations as part of the calculation path. For example, one technical computation could be applying Access Rights or permissions onto an object before the calculation is executed. 
    • A blue bar displays the amount of time taken for the execution of each item within the calculation path. The Execution property measures the object’s Computation duration in the calculation path after an update is done in the Application.
      Here’s how the Execution property represents data for specific Blocks in Pigment: 
      • Metrics and List Properties. Execution duration typically represents the time taken for the formula to run. If you optimize formulas in Metrics and List Properties, you can can reduce this time. Ensuring that the formula or the preceding computation object is fully or partially scoped also helps to optimize Execution duration.
      • Tables. Execution duration typically represents the time it takes for the model to display the Metrics on the View of the Table. Ensuring that the formulas in preceding objects that lead to the Table are fully or partially scoped also helps to optimize Execution duration.
  • Search. Use the Search bar to search for any output object of interest within the calculation path. This allows you to assess at a glance any objects of interest that you might want to optimize following a specific action in your model.

 


0 replies

Be the first to reply!

Reply