Profiling X3 code for performance

By | November 27, 2015

Profiling the Sage ERP X3 script code is important to obtain the best possible performance. It localizes time consuming programs and measures how often certain code sections are called. This is possible by using a dedicated library. This is a two-step process to get the profiling of X3 code (i.e Start and stop of profiling process)

New Stuff: Set default bank globally in Sage ERP X3

  1. Starting the profile process

This is performed by using the function ASYRTIMING.START

STAT=func ASYRTIMING.START(“”,1)
This function includes two parameters:

  • A string character value that defines the temporary file name without an extension and path, where the calls and timestamps are written. If an empty value is given, the name will be generated.
  • An additional integer is set to ‘0’ by default. Its value will be modified to ‘1’ if the code called by Gosub needs to be analyzed.
  1. Ending the profile process

This is performed by using the function ASYRTIMING.STOP

STAT=func ASYRTIMING.STOP(GACTX,””,1,WFICTRACE)
This function includes four parameters:

  • A pointer on the current context.
  • The temporary file name where the calls and timestamps have been written. If the file name is not provided, the same algorithm will be used to generate it.
  • The same integer value to know if Gosub must be analyzed.
  • A string variable that returns the generated detailed log file.

For Example:

# Start the profile
Local integer STAT
STAT=func ASYRTIMING.START(“”,1)
# The X3 code

# End the profile
Local char WFICTRACE
STAT=func ASYRTIMING.STOP(GACTX,””,1,WFICTRACE)

You get the log generated when the function stops which can be read by you in log reading.

Below is the snippet of the log generated by the profiling process.

Hope this Helps!

About Us
Greytrix – a globally recognized Premier Sage Gold Development Partner is a one-stop solution provider for Sage ERP and Sage CRM needs. Being recognized and rewarded for multi-man years of experience, we bring complete end-to-end assistance for your technical consultations, product customizations, data migration, system integrations, third-party add-on development and implementation expertise.

Greytrix caters to a wide range of Sage Enterprise Management (Sage X3) offerings – a Sage Business Cloud Solution. Our unique GUMU™ integrations include Sage Enterprise Management (Sage X3) for Sage CRMSalesforce.com and Magento eCommerce along with Implementation and Technical Support worldwide for Sage Enterprise Management (Sage X3). Currently we are Sage Enterprise Management Implementation Partner in East Africa, Middles East, Australia, Asia. We also offer best-in-class Sage X3 customization and development services, integrated applications such as POS | WMS | Payment Gateway | Shipping System | Business Intelligence | eCommerce and have developed add-ons such as Catch – Weight  and Letter of Credit for Sage Enterprise Management to Sage business partners, end users and Sage PSG worldwide.

Greytrix is a recognized Sage Rockstar ISV Partner for GUMU™ Sage Enterprise Management – Sage CRM integration also listed on Sage Marketplace; GUMU™ integration for Sage Enterprise Management – Salesforce is a 5-star app listed on Salesforce AppExchange.

For more information on Sage X3 Integration and Services, please contact us at x3@greytrix.com. We will be glad to assist you.