Measuring Performance

Before you ship your code or install it on production machines, you must at least go through a performance analysis cycle of your KM. That means measure how much CPU your KM is consuming and if you can solve the performance bottlenecks. After a while you develop a feeling for what the more expensive calls are under different circumstances, but before you are there, you will have to go through a lot of KM analysis and optimize a lot of PSL code yourself.

The PSL Profiler saves the profile data for PSL processes to the profile as they terminate. The agent's data includes the following:

  • Number of PSL processes profiled
  • Elapsed time of the agent
  • Cumulative CPU time of the agent
  • Average percent CPU load of the agent

Standalone compiler interpreter

It is possible to test your standalone psl scripts by using the standalone psl compiler/interpreter. After you run your psl with profiling mode enabled, you can run ppv (PATROL profile viewer) on the result to examine the profiling result. 

To activate the PSL Profiler, use any of the following methods:

  • When starting the agent, type: ./PatrolAgent - profiling
  • With the PSL compiler, type: psl -p
  • Via PSL API, use either of the following: ProfDefaultOptions() ProfOptios()

Agent Command Line option

You can start the agent in profiling mode (-profiling). When you do that the agent will generate a profile file that contains profiling information about all PSL processes that were running in the agent while it was running. 

Again, use ppv to examine the profiling result.

From PSL

If you just want to profile a piece of your PSL code, you can enable PSL profiling on a very granular level as follows:

  • ProfDefaultOptions(options)
    • Omitting options returns the current defaults
    • Does not affect existing processes
  • ProfOptions(pid, options)
    • Existing processes can be queried or changed 

      For more information about these items, see the PSL Reference Manual.
Was this page helpful? Yes No Submitting... Thank you

Comments