What are your top 3 XPages performance tips for new XPages developers?

后端 未结 6 1118
清歌不尽
清歌不尽 2021-02-06 15:43

What 3 things would you tell developers new to XPages to do to help maximize the performance of their XPages apps?

相关标签:
6条回答
  • 2021-02-06 16:29

    The basics like

    1. Use the immediate flags ( or one of the other flags) on serverside events if possible
    2. Check the Flag which (forgot its name..) generates the css and js as one big file at runtime therefore minimizing the ammount of requests.
    3. Choose your scope wisely. Dont put everything in your sessionscope but define when, where and how your are using the data and based on that use the correct scope. This can lead to better memory usage..

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


    Other tips I would add:

    1. When retrieving data use viewentrycollections or the viewnavigstor
    2. Upgrade to 8.5.3
    3. Use default html tags if possible. If you dont need the functionality of a xp:div or xp:panel use a <div> instead so you dont generate an extra uicomponent on the tree.
    4. Define what page persistance mode you need
    0 讨论(0)
  • 2021-02-06 16:30
    1. Not sure if this tipp is for beginners, but use any of the LifeCyclePhaseListeners from the OpenNTF Snippets to see what is going on in your datasources during a complete or partial refresh (http://openntf.org/XSnippets.nsf/snippet.xsp?id=a-simple-lifecyclelistener-)

    2. Use the extension Library. Report Bugs ( or what you consider a bug ) at OpenNTF.

    3. Use the SampleDb from the extLib. ou can easily modify the samples to your own need. Even good for testing if the issue you encounter is reproducable in this DB.
    4. Use Firebug ( or a similar tool that comes with the browser of your choice ) If you see an error in the error tab, go and fix it.
    0 讨论(0)
  • 2021-02-06 16:33

    Depends a lot what you mean by performance. For performance of the app:

    1. Use compute on page load wherever feasible. It significantly improves performance.
    2. In larger XPages particularly, combine code into single controls where possible. E.g. Use a single Computed Field control combining literal strings, EL and SSJS rather than one control for each language. On that point, EL performs better than SSJS, and SSJS on the XPage performs better than SSJS in a Script Library.
    3. Use dataContexts for properties that are calculated more than once on an XPage.

    Partial Execution mode is a very strong recommendation, but probably beyond new XPages developers at this point. Java will also perform better than SSJS in a Script Library, but again beyond new developers. XPages controls you've created with the Extensibility Framework should perform better, because they should run fewer lines of Java than multiple controls, but I haven't tested that.

    If you mean performance of the developer:

    1. Get the Extension Library.
    2. Use themes to set default properties, e.g. A standard style for all your pagers.
    3. Use Firebug. If you're developing for Notes Client or IE, still use Firebug. You'll spend longer suffering through Client/IE thank you will fixing the few quirks that will remain.
    0 讨论(0)
  • 2021-02-06 16:41
     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.
    
    0 讨论(0)
  • 2021-02-06 16:42

    Tim Tripcony had given a bunch of suggestion here.

    http://www-10.lotus.com/ldd/xpagesforum.nsf/topicThread.xsp?action=openDocument&documentId=365493C31B0352E3852578FD001435D2#AEFBCF8B111E149B852578FD001E617B

    0 讨论(0)
  • 2021-02-06 16:43

    Since you're asking for only 3, here are the tips I feel make the biggest difference:

    1. Determine what your users / customers mean by "performance", and set the page persistence option accordingly. If they mean scalability (max concurrent users), keep pages on disk. If they mean speed, keep pages in memory. If they want an ideal mixture of speed and scalability, keep the current page in memory. This latter option really should be the server default (set in the server's xsp.properties file), overridden only as needed per application.
    2. Set value bindings to compute on page load (denoted by a $ in the source XML) wherever possible instead of compute dynamically (denoted by a #). $ bindings are only evaluated once, # bindings are recalculated over and over again, so changing computations that only need to be loaded once per page to $ bindings speed up both initial page load and any events fired against the page once loaded.
    3. Minimize the use of SSJS. Wherever possible, use standard EL instead (e.g. ${database.title} instead of ${javascript:return database.getTitle();}). Every SSJS expression must be parsed into an abstract syntax tree to be evaluated, which is incrementally 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 gain noticeable improvement.

    0 讨论(0)
提交回复
热议问题