Optimization of the client-side code

   

Scope: managed applications, mobile applications, and ordinary applications.

1.1. Minimize client-side code execution by avoiding complex algorithms that require a lot of resources. Note that it is more time-consuming to run such algorithms on the client than to transfer control to the server, execute the algorithm, and return the result to the client.

Place such algorithms in the server code and limit the number of client calls to them.

See also: Server call optimization

This requirement is driven by the following factors:

  • The client computer is typically less powerful than the server.
  • You need to ensure a good user experience in the web client. The 1C:Enterprise language interpreter, which executes the client code, runs much slower in the web client compared to the thin or thick clients.

1.2. If executing an algorithm on the client takes less time than making a server function call, place it on the client side. For example, recalculation of form control availability when a user modifies data should occur on the client, as making a context server call for a complex form might disrupt user operations.

See also: Web client — Spreadsheet documents

2.1. This rule does not apply to scenarios when a functional subsystem is used for operations with software installed on the client computer. This includes operations with point-of-sale equipment, integration with client banks, generation of print forms for office applications, and so on.

2.2. In cases where a functional subsystem is only used in certain client modes, use preprocessor directives. For example, if some functionality is unavailable in the web client:

#If WebClient Then
 DoMessageBox(NStr("en = 'Cannot import address classifier in web client.'"));
 #Else
 OpenForm("InformationRegister.AddressClassifier.Form.AddressClassifierImportForm");
 #EndIf

   

Icon/Social/001 Icon/Social/006 Icon/Social/005 Icon/Social/004 Icon/Social/002