What are your best XPages performance recommendations for new XPages developers?

What 3 things will you tell developers new to XPages to help maximize the performance of their XPages applications?

+4
source share
6 answers
  • Not sure if this tipp is for beginners, but use any of the LifeCyclePhaseListeners from OpenNTF snippets to find out what happens in your data sources during a full or partial update (http://openntf.org/XSnippets?.nsf/snippet.xsp Id = a-simple-lifecyclelistener -)

  • Use the extension library. Report bugs (or what you think is a bug) in OpenNTF.

  • Use SampleDb from extLib. ou can easily modify samples to suit your needs. Even good for testing if the problem you are facing is reproduced in this database.
  • Use Firebug (or a similar tool that comes with your chosen browser). If you see an error in the error tab, go and fix it.
+3
source

Since you only ask for 3, here are the tips I feel have the biggest difference:

  • Determine what your users / clients mean by "performance", and set the page save option accordingly. If they mean scalability (maximum concurrent users), save the pages to disk. If they mean speed, keep the pages in mind. If they want the perfect mix of speed and scalability, keep the current page in mind. This last option should really be the default server (installed in the xsp.properties server file), redefined only as necessary for each application.
  • Set value bindings for calculations on page load (indicated by the $ symbol in the source XML), where possible, instead of dynamic calculations (indicated by the # symbol). $ bindings are evaluated only once, # bindings are recounted again and again, therefore, changing calculations that need to be loaded only once per page to $ bindings speeds up loading the start page as well as any events triggered after a loaded page.
  • Minimize the use of SSJS. If possible, use a standard EL instead (for example, $ {database.title} instead of $ {javascript: return database.getTitle ();}). Each SSJS expression must be parsed into an abstract syntax tree that must be evaluated, which is gradually slower than the standard EL resolver.

There are many other ways to maximize performance, of course, but, in my opinion, these are the easiest ways to achieve noticeable improvement.

+3
source
1. Use the Script Library instead writing a bulk of code into the Xpage. 2. Use the Theme or separate CSS class for each elements [Relational] 3. Moreover try to control your SSJS code. Because server side request only reduce our system performance. 4. Final point consider this as sub point of 3, Try to get the direct functions from our SSJS, Don't use the while llop and for loop for like document collection, count and other things. 
+2
source

Basics for example

  • Use the checkboxes (or one of the other flags) on the servers, if possible.
  • Check the flag that (forgot its name ..) generates css and js as one large file at runtime, therefore minimizing the number of requests.
  • Choose your reach wisely. Do not put everything in your session, but determine where, where and how you use the data and based on which the correct area is used. This can lead to better memory usage.

And, of course, the most important one is to read the xpages mastering book.


Other tips I would add:

  • When retrieving data, use viewentrycollections or viewnavigstor
  • Update to 8.5.3
  • If possible, use the default html tags. If you do not need the functionality of the xp: div or xp: panel, use <div> instead, so that you do not generate additional uicomponent on the tree.
  • Determine which page scroll mode you need.
+1
source

Depends on what you mean by performance. To run the application:

  • Use calculation when loading a page where possible. This greatly improves performance.
  • In large XPages, in particular, combine code into separate controls where possible. For instance. Use a single Computed Field command that combines literal strings, EL, and SSJS, rather than a single control for each language. At this point, EL works better than SSJS, and SSJS on XPage works better than SSJS in the Script library.
  • Use dataContexts for properties that are evaluated more than once in XPage.

Partial Execution mode is a very strong recommendation, but perhaps outside of the new XPage developers. Java will also work better than SSJS in the Script library, but again outside of the new developers. The XPages controls that you created using the Extensibility Framework should work better because they should run fewer Java strings than multiple controls, but I have not tested this.

If you mean developer productivity:

  • Get the library of extensions.
  • Use themes to set default properties, for example. Standard style for all your pagers.
  • Use Firebug. If you are developing for Notes Client or IE, still use Firebug. You will spend longer suffering through Client / IE, thanks for fixing a few quirks that will remain.
+1
source

Source: https://habr.com/ru/post/1400934/


All Articles