SlideShare a Scribd company logo
1 of 68
Ulrich Krause, Milano, 27 Settembre 2013

La vita nella corsia di sorpasso
A tutta velocità, XPages!
Life in the Fast Lane – Full Speed XPages!

About: me
Administrator /Developer since 1993
Senior Software Architect at BCC
OpenNTF Contributor
OpenNTF Board of Directors
Blog http://www.eknori.de

IBM Champion 2011/2012/2013
Notes Forum (http://www.atnotes.de)
Life in the Fast Lane – Full Speed XPages!

Agenda
What factors affect Performance?
Java vs. JavaScript
ViewNavigator vs. GetNextDocument
Stringbuilder vs. Concat (+)
JSF Lifecycle Listener
Partial Update / Partial Execute
Variable Resolver
Tools
Life in the Fast Lane – Full Speed XPages!

XPages Request
Life in the Fast Lane – Full Speed XPages!

Hardware
The hardware used has a significant influence on
performance. There are 3 key elements:
• CPU
• Main Memory
• Hard Disk
Life in the Fast Lane – Full Speed XPages!

Hardware
Main Memory
• Limit defined by the operating system
•  Scalability

CPU

• Cores / Clock / Cache
•  Poor response time

Weak CPU AND Low Memory
• Poor overall performance
• Poor response times
• Server "hangs"
Life in the Fast Lane – Full Speed XPages!

Network
Latency
• Time taken for data transmission between multiple computers on a
network

Bandwidth

• Rate of transmission of data

Greater Bandwidth
+ Lower Latency
-------------------------------= Better Connection
Life in the Fast Lane – Full Speed XPages!

Client & Browser
Hardware
How many data requests / responses are transmitted
How much data is transferred (size)
Caching of resources
How much CSJS runs
Size / complexity of the CSS
Complexity of the site structure
Life in the Fast Lane – Full Speed XPages!

Limiting factors on performance
Browser / HTTP server
• Network latency – distance/time to server.
• Bandwidth – size of files.
• Browser limits on concurrent downloads
• IE7 allows 2 downloads, IE8 allows 6

HTTP Server / App Server
• HTTP Server JVM heap size & garbage collector
• CPU time, competition between threads, gives slower response times
• Threads, limited to 40 by default
Life in the Fast Lane – Full Speed XPages!

Limiting factors on performance
App Server / Domino context
• Read design elements from the NSF (XPage .class files, form structure,
etc)
• Backend API calls may be expensive, especially for large data sets.
• Design elements may be network requests.
Life in the Fast Lane – Full Speed XPages!

Limiting factors on performance
Servlet / Lifecycle
• Restore control tree – file system read. Control tree locking – no
concurrent access.
• Rendered re-evaluated for every control for most phases

Browser/Client JavaScript/Dojo
• Inline JavaScript blocks insertion of later HTML elements into the DOM
tree
• Dojo does AJAX requests for .js files for dojo modules that are not loaded
Life in the Fast Lane – Full Speed XPages!

General Performance Options
notes.ini
• HTTPJVMMaxHeapSizeSet=1
• HTTPJVMMaxHeapSize=256M
• Should be set to ¼ of the available RAM

Domino Administrator
• HTTP server "Enable logging to" disabled
• HTTP server thread count – defaults to 40

Remember, enabling the debugger affects performance
• JavaEnableDebug=1
• JavaDebugOptions=transport=dt_socket,server=y,suspend=n,address=8000
• JavascriptEnableDebug=1
Life in the Fast Lane – Full Speed XPages!

Reducing Memory Utilization
xsp.persistence.mode=
• Defines the persistence mode for the JSF pages
• file: All the pages are persisted on disk
• fileex: All the pages are persisted on disk except the current one, which stays
in memory
• <else>: All the pages stay in memory (tree mode)
Life in the Fast Lane – Full Speed XPages!

XPages Design Optimizations
Use Simple actions vs links or button with
window.location JS
Reduce server phase processing
• Use partial update where possible
• Use partial execute where possible
• Use disableValidators & immediate event

Minimize work in rendered / visible computations
• Use variable resolver

When using Repeats & Views
• Use viewEntry.getColumnValue instead of viewEntry.getDocument.getColumn
• Use Domino View data source dataCache property where possible
Life in the Fast Lane – Full Speed XPages!

XPages Design Optimizations
Load-time vs Runtime
• Using loaded vs rendered
• ExtLib Dynamic Content
• allows partial re-loading, so more use of load-time optimizations

Loading resources in the browser
• CSS & browser JS
• extract to separate files. Minify & compress files

• Images
• use correct size & format. Use CSS Image Sprites as possible
Life in the Fast Lane – Full Speed XPages!

JavaScript/CSS Aggregation
Groups many DOJO, CSS / JS files into a single file
•
•
•
•

Less requests from the browser to the server
Performance improvements on networks with high latency
Enhanced performance parsing CSS / JS
Fewer connections to the server
On the Server: xsp.properties:

xsp.resources.aggregate=true
Life in the Fast Lane – Full Speed XPages!

JavaScript/CSS Aggregation
Life in the Fast Lane – Full Speed XPages!

XPages PreLoad
XPagesPreload=1
New Feature in Notes / Domino 8.5.3
Works on Server and Client
Java classes from the XPages runtime plug-ins loaded
from a fixed list of runtime classes ( 435 in ND 8.5.3 )
• com.ibm.xsp.core, common utility, JS wrapper, FSF runtime classes

Java classes referenced in *-faces.config.xml
• XPages control renderer, data sources, complex types
Life in the Fast Lane – Full Speed XPages!

XPages PreLoad
XPagesPreloadDB =
Server!!Db.nsf/XPage.xsp, myLocalDb.nsf

Works at the application level
The application is loaded on the client / server startup
into memory.
• This happens even when the application is first opened in the browser
Life in the Fast Lane – Full Speed XPages!

XPages PreLoad (cont.)
For each entry in the notes.ini variable, an XPage URL
is generated and sent to the server
The application is loaded, and the HTML generated

The XPages runtime discards the HTML, but retains the
application in memory
Life in the Fast Lane – Full Speed XPages!

Scoped Variables
applicationScope
• Are visible for all users of one application.
• Expires some time after the last user used an applicationScope variable.
• applicationScope variables are NOT persistent forever.

sessionScope

• Is valid through the session of the current user.
• A user session expires after some time of inactivity.
• Uses don't have access to the sessionScope variables of other users.
Life in the Fast Lane – Full Speed XPages!

Scoped Variables (cont.)
viewScope
• Is visible for views on the current page only.
• Useful for transporting a search query to a view.

requestScope
• Is valid through one request of the current user.
• That includes refreshing of a page.
Life in the Fast Lane – Full Speed XPages!

Caching with Application Scope
Life in the Fast Lane – Full Speed XPages!

JSF Lifecycle
Life in the Fast Lane – Full Speed XPages!

XPages Lifecycle Listener
What happens in each phase of the JSF lifecycle?

Ulrich Krause: http://openntf.org/XSnippets.nsf/snippet.xsp?id=a-simple-lifecyclelistener-
Life in the Fast Lane – Full Speed XPages!

XPages Masterclass

http://www.openntf.org/internal/home.nsf/project.xsp?action=openDocument&name=XPages%20Masterclass
Life in the Fast Lane – Full Speed XPages!

When to Execute - # vs $
#
• Executed every time the page is rendered
• Use for values that are likely to change

$

• Executed when the page is first loaded
• Use for values that don't change
Life in the Fast Lane – Full Speed XPages!

DataContext
Can be thought of as global variables
Value can be computed dynamically or on page load
• You can use ${javascript:@Today()} and run it once rather than running a
function each time.

Can be scoped to any level that datasources can

• XPage, Custom Control or Panel
• Set a dataContext in a panel in a repeat control to avoid multiple
references to a NotesDocument's item

Is Referenced using EL

• At no point in the references do you run SSJS
• Not having to go through the SSJS parser
Life in the Fast Lane – Full Speed XPages!

DataContext - Pitfall
Do not bind data context variables dynamically.
• They will be recomputed again and again, even when in partial execution
mode and if they are not in use
Life in the Fast Lane – Full Speed XPages!

DataContext - Pitfall
Life in the Fast Lane – Full Speed XPages!

Partial Refresh / Update (Pro)
Reduced control processing in the render response
phase
• Means less work on the server
• RenderResponse is the most intensive phase

Smaller response from server.
• Means reduced network usage

Better browser experience
• Rest of the page is still visible while waiting for a response
• Inserting small sections into the page is much faster than reloading a full
page.
Life in the Fast Lane – Full Speed XPages!

Partial Refresh / Update (Cons)
Dependancy outside of the partial update area
• Other areas of the control tree are not processed,so any SSJS scripts in
those other controls will not be run.
• Enabling Partial Update where it was previously full update may lead to
functional problems

Only one area may be partial updated by default

• In CSJS you can schedule later partial updates of related areas, but any
concurrent requests will wait for exclusive access to the server-side
control tree before processing on the server

http://www.timtripcony.com/blog.nsf/d6plinks/TTRY-84B6VP
Life in the Fast Lane – Full Speed XPages!

Partial Refresh / Update (Cons)
Refreshing more than one target ID in a single partial
refresh event
• http://www.timtripcony.com/blog.nsf/d6plinks/TTRY-84B6VP
Life in the Fast Lane – Full Speed XPages!

Partial Execution
Reduced processing in the 3 data-processing phases
• Means less work on the server, faster response times

Dependancy on Edit Box values outside of the exec area
• Submitted values from Edit Boxes and/or other input controls in other
areas of the control tree are not processed, so any control values and
document fields in those other areas will not be updated.
• Enabling Partial Exec where it was previously full execution may lead to
functional problems where values are out-of date in the onclick script or
in the redisplayed page.
Life in the Fast Lane – Full Speed XPages!

Partial Execution (cont.)
onclick Event Handler must be in the exec area
• The ApplyRequestValues phase prepares for the invokeApplication phase.
• The onclick simple action or SSJS script won't occur if outside the partial
exec area
Life in the Fast Lane – Full Speed XPages!

Partial Execution
execMode added in 8.5.1 (not in 8.5.0)
execId slightly difficult to select in Designer
• Select your button, in the Outline view, toggle open the button, select
the child Event Handler control, then set the execId property on the Event
Handler.
• [Better UI proposed in Notes/Domino Next – in the Events tab]
Life in the Fast Lane – Full Speed XPages!

disableValidators / immediate
disableValidators
•
•
•
•

JSF life cycle through all phases (1-6)
But requests will not validate the data
Converters continue to work.
Items in documents will be updated

Immediate
•
•
•
•

JSF Lifecycle processes only phases (1, 2, 6)
No data processing
Items in documents are not updated
Onclick event handler scripts and render response calculations are
performed
Life in the Fast Lane – Full Speed XPages!

Minimize work in rendered/ visible
computation like CSS “style” are only computed in
Most properties,

the RenderResponse phase
Edit Box and input “value” properties are used in Data
Processing phases and RenderResponse phase
Data Source properties are computed during
RenderResponse
• Results are cached for the next request's Data Processing and
InvokeApplication phases
Life in the Fast Lane – Full Speed XPages!

Minimize work in rendered / visible
computationproperty is computed in all 5 lifecycle
The rendered

phases
Avoid re-computing values in every rendered property
• @DbLookup, @DbColumn, getDocumentByKey
• In the rendered property, save the computed boolean to a viewScope
variable
Life in the Fast Lane – Full Speed XPages!

Using loaded vs rendered
Loaded
• is only computed once in the createView phase
• not re-computed in the other phases

• false means the control is not created, so it can never be rendered.
• true means the control is added to the control tree.
• You can still compute rendered when loaded evaluates to true.

Compute the loaded property on conditions

• where you could compute the rendered property and save it to the view
scope. It would never need to be recomputed for the rest of the
interaction with this page
Life in the Fast Lane – Full Speed XPages!

Images
Use correct file type depending on content
• JPEG for complex and detailed images
• PNG/GIF for simple images, fonts, transparencies
• Use the HTML <img> tag “width” and “height” attributes

For faster HTML layout in the browser
• Size the image to size you intend to use
• Resizing using html attributes height and width will delay the rendering of
your page
• Images larger than necessary will waste bandwidth
Life in the Fast Lane – Full Speed XPages!

Image Sprites
Use CSS Image Sprites
• If you have multiple small images, make a single larger image containing
the smaller images
• Use CSS to display only the relevant subset image at a location in the
page
• For semantically significant sprites, provide an accessibility “title”
attribut (as sprites don't use the IMG “alt” attribute, but you still want to
assist blind users)
• There's no specific XPages support for sprites, but they're used in the
XPages OneIU themes
Life in the Fast Lane – Full Speed XPages!

CSS Image Sprite Sample

http://www.w3schools.com/css/tryit.asp?filename=trycss_sprites_img
Life in the Fast Lane – Full Speed XPages!

XPages Toolbox
XPages based Application
• Runs on the Domino server or the Notes client
• An NSF needs to be installed on the server/Notes client
• A profiler jar file should be added to the JVM launch options

Measures CPU performance and memory allocation
Available from OpenNTF.org
• Free open source project
• http://www.openntf.org/internal/home.nsf/project.xsp?action=openDocu
ment&name=XPages%20Toolbox

Extended in 8.5.2 to support backend classes profiling
Life in the Fast Lane – Full Speed XPages!

XPages Toolbox
Life in the Fast Lane – Full Speed XPages!

XPages Toolbox
Generate a heap dump of the JVM running in the HTTP
task
• A button in the XPages profiler generates the heap dump
• From the Domino console
• tell http xsp heapdump (triggers com.ibm.jvm.Dump.HeapDump())
• tell http xsp javadump (triggers com.ibm.jvm.Dump.JavaDump())

Analyze the heap dump using the Eclipse memory
analyzer
• http://www.eclipse.org/mat/
• http://www.ibm.com/developerworks/java/jdk/tools/dtfj.html
Life in the Fast Lane – Full Speed XPages!

Heapdump / Javadump Analyzer
Life in the Fast Lane – Full Speed XPages!

More Tools
Print statements
• In rendered/visible computations to see how often executed
• print("panel2 evaluating rendered property");

• In the XPages root control events:
• before/afterPageLoad, afterRestoreView, before/afterRenderResponse.

• Custom control root events:
• before/afterPageLoad.

• In the document data source events:
• queryNewDocument, postSaveDocument, etc.

Task Manager and/or Process Explorer
• Shows CPU usage & process memory usage as it happens
Life in the Fast Lane – Full Speed XPages!

More Tools
Browser developer tools
• for watching network transactions, partial updates, response times
• BROWSER: Firebug, Developer Tools
• XPiNC: FirebugLite from ExtLib

Java / Javascript Debugging

• Degrades performance but can inspect objectsUse the Eclipse Java
debugger.
• In Dominonotes.ini add these 2 options:
• JavaEnableDebug=1
• JavaDebugOptions=transport=dt_socket,server=y,suspend=n,address=8000
Life in the Fast Lane – Full Speed XPages!

Optimization – Step By Step
Life in the Fast Lane – Full Speed XPages!

XAgent – SSJS
Get all „Contacts“ into a NotesDocumentCollection,
loop the collection and build the JSON by reading the
values from items in the document
Life in the Fast Lane – Full Speed XPages!

XAgent – SSJS
Life in the Fast Lane – Full Speed XPages!

XAgent – SSJS – UNID from Item
Get all „Contacts“ into a NotesDocumentCollection,
loop the collection and build the JSON by reading the
values from items in the document. Also UNID is stored
in document
Life in the Fast Lane – Full Speed XPages!

XAgent – SSJS – UNID from Item
Life in the Fast Lane – Full Speed XPages!

XAgent – SSJS - SingleItem
Get all „Contacts“ into a NotesDocumentCollection,
loop the collection and get the JSON from an item on
the document. JSON is calculated on document save
Life in the Fast Lane – Full Speed XPages!

XAgent – SSJS - SingleItem
Life in the Fast Lane – Full Speed XPages!

XAgent – SSJS – ViewNavigator
loop thru a view and get the JSON from a view column.
Life in the Fast Lane – Full Speed XPages!

XAgent – SSJS – ViewNavigator
Life in the Fast Lane – Full Speed XPages!

StringBuilder vs String.concat
Concatenation of Strings is very easy in Java - all you
need is a '+‘
Each time you append something via '+'
(String.concat()) a new String is created, the old stuff
is copied, the new stuff is appended, and the old String
is thrown away. The bigger the String gets the longer it
takes - there is more to copy and more garbage is
produced.
Accordingly to Arno Unkrig the optimal strategy is to
use String.concat() for 2 or 3 operands, and
StringBuilder for 4 or more operands
Life in the Fast Lane – Full Speed XPages!

StringBuilder vs String.concat
When to use StringBuilder over '+' (String.concat()) ?
• use StringBuilder whenever you assemble a String in a loop
• Keep in mind that '+' isn't always a good idea

http://kaioa.com/node/59
Life in the Fast Lane – Full Speed XPages!

XAgent – SSJS – ViewNavigator +
StringBuilder and get the JSON from a view column.
loop thru a view
Use a StringBuilder to concat the JSON
Life in the Fast Lane – Full Speed XPages!

XAgent – SSJS – ViewNavigator +
StringBuilder
Life in the Fast Lane – Full Speed XPages!

XAgent – Java
loop thru a view and get the JSON from a view column.
Use a StringBuilder to concat the JSON + use Java
instead of SSJS
Life in the Fast Lane – Full Speed XPages!

XAgent – Java
Life in the Fast Lane – Full Speed XPages!

Themes
Single document containing references to all your CSS
resources
• resource sections reference the CSS files
• control section define what CSS classes are applied to specific controls

XML based and easy To learn

• creating a new theme document prefills sample content

Can extend other themes

• <theme extends="webstandard">
• will automatically include all the resource and control definitions from
that theme
Life in the Fast Lane – Full Speed XPages!

Themes
Create your own themes from scratch.
• Extending an existing theme will include extra stylesheets and styles that
you might not need.

Be prepared to spend more time writing css though
Life in the Fast Lane – Full Speed XPages!

Load Resources from Themes
Global Application / Configuration properties
Questions ?

Feedback
ulrich_krause@bcc.biz

More Related Content

What's hot

#DNUG45 - IBM Notes and Domino Performance Boost - Reloaded
 #DNUG45 - IBM Notes and Domino Performance Boost - Reloaded #DNUG45 - IBM Notes and Domino Performance Boost - Reloaded
#DNUG45 - IBM Notes and Domino Performance Boost - ReloadedChristoph Adler
 
Soccnx10: Best and worst practices deploying IBM Connections
Soccnx10: Best and worst practices deploying IBM ConnectionsSoccnx10: Best and worst practices deploying IBM Connections
Soccnx10: Best and worst practices deploying IBM Connectionspanagenda
 
Getting Started with the OpenNTF Domino API
Getting Started with the OpenNTF Domino APIGetting Started with the OpenNTF Domino API
Getting Started with the OpenNTF Domino APITeamstudio
 
IBM Connect 2016 - 60+ in 60 - Admin Tips Power Hour
IBM Connect 2016 - 60+ in 60 - Admin Tips Power HourIBM Connect 2016 - 60+ in 60 - Admin Tips Power Hour
IBM Connect 2016 - 60+ in 60 - Admin Tips Power HourChris Miller
 
IBM Connections administration – keep your systems running the right way
IBM Connections administration – keep your systems running the right wayIBM Connections administration – keep your systems running the right way
IBM Connections administration – keep your systems running the right wayLetsConnect
 
Unboxing HCL Notes/Domino v12!
Unboxing HCL Notes/Domino v12!Unboxing HCL Notes/Domino v12!
Unboxing HCL Notes/Domino v12!panagenda
 
What We Wish We Had Known: Becoming an IBM Connections Administrator
What We Wish We Had Known: Becoming an IBM Connections AdministratorWhat We Wish We Had Known: Becoming an IBM Connections Administrator
What We Wish We Had Known: Becoming an IBM Connections AdministratorGabriella Davis
 
IBM Lotus Notes / Domino upgrades
IBM Lotus Notes / Domino upgradesIBM Lotus Notes / Domino upgrades
IBM Lotus Notes / Domino upgradesDarren Adams
 
IBM Domino / IBM Notes Performance Tuning
IBM Domino / IBM Notes Performance Tuning IBM Domino / IBM Notes Performance Tuning
IBM Domino / IBM Notes Performance Tuning Vladislav Tatarincev
 
Connections install in 45 mins
Connections install in 45 minsConnections install in 45 mins
Connections install in 45 minsSharon James
 
be the captain of your connections deployment
be the captain of your connections deploymentbe the captain of your connections deployment
be the captain of your connections deploymentSharon James
 
Best And Worst Practices Deploying IBM Connections
Best And Worst Practices Deploying IBM ConnectionsBest And Worst Practices Deploying IBM Connections
Best And Worst Practices Deploying IBM ConnectionsLetsConnect
 
Practical solutions for connections administrators
Practical solutions for connections administratorsPractical solutions for connections administrators
Practical solutions for connections administratorsSharon James
 
XPages: No Experience Needed
XPages: No Experience NeededXPages: No Experience Needed
XPages: No Experience NeededKathy Brown
 
What's New in Notes, Sametime and Verse On-Premises
What's New in Notes, Sametime and Verse On-PremisesWhat's New in Notes, Sametime and Verse On-Premises
What's New in Notes, Sametime and Verse On-PremisesGabriella Davis
 
Web Performance First Aid
Web Performance First AidWeb Performance First Aid
Web Performance First AidAlan Seiden
 
Best and worst practices deploying IBM Connections
Best and worst practices deploying IBM ConnectionsBest and worst practices deploying IBM Connections
Best and worst practices deploying IBM ConnectionsLetsConnect
 
Transformations: Smart Application Migration to XPages
Transformations: Smart Application Migration to XPagesTransformations: Smart Application Migration to XPages
Transformations: Smart Application Migration to XPagesTeamstudio
 

What's hot (20)

#DNUG45 - IBM Notes and Domino Performance Boost - Reloaded
 #DNUG45 - IBM Notes and Domino Performance Boost - Reloaded #DNUG45 - IBM Notes and Domino Performance Boost - Reloaded
#DNUG45 - IBM Notes and Domino Performance Boost - Reloaded
 
IBM Connections adoption seminar
IBM Connections adoption seminarIBM Connections adoption seminar
IBM Connections adoption seminar
 
Soccnx10: Best and worst practices deploying IBM Connections
Soccnx10: Best and worst practices deploying IBM ConnectionsSoccnx10: Best and worst practices deploying IBM Connections
Soccnx10: Best and worst practices deploying IBM Connections
 
Getting Started with the OpenNTF Domino API
Getting Started with the OpenNTF Domino APIGetting Started with the OpenNTF Domino API
Getting Started with the OpenNTF Domino API
 
IBM Connect 2016 - 60+ in 60 - Admin Tips Power Hour
IBM Connect 2016 - 60+ in 60 - Admin Tips Power HourIBM Connect 2016 - 60+ in 60 - Admin Tips Power Hour
IBM Connect 2016 - 60+ in 60 - Admin Tips Power Hour
 
IBM Connections administration – keep your systems running the right way
IBM Connections administration – keep your systems running the right wayIBM Connections administration – keep your systems running the right way
IBM Connections administration – keep your systems running the right way
 
Unboxing HCL Notes/Domino v12!
Unboxing HCL Notes/Domino v12!Unboxing HCL Notes/Domino v12!
Unboxing HCL Notes/Domino v12!
 
What We Wish We Had Known: Becoming an IBM Connections Administrator
What We Wish We Had Known: Becoming an IBM Connections AdministratorWhat We Wish We Had Known: Becoming an IBM Connections Administrator
What We Wish We Had Known: Becoming an IBM Connections Administrator
 
IBM Lotus Notes / Domino upgrades
IBM Lotus Notes / Domino upgradesIBM Lotus Notes / Domino upgrades
IBM Lotus Notes / Domino upgrades
 
IBM Domino / IBM Notes Performance Tuning
IBM Domino / IBM Notes Performance Tuning IBM Domino / IBM Notes Performance Tuning
IBM Domino / IBM Notes Performance Tuning
 
Connections install in 45 mins
Connections install in 45 minsConnections install in 45 mins
Connections install in 45 mins
 
be the captain of your connections deployment
be the captain of your connections deploymentbe the captain of your connections deployment
be the captain of your connections deployment
 
Best And Worst Practices Deploying IBM Connections
Best And Worst Practices Deploying IBM ConnectionsBest And Worst Practices Deploying IBM Connections
Best And Worst Practices Deploying IBM Connections
 
Practical solutions for connections administrators
Practical solutions for connections administratorsPractical solutions for connections administrators
Practical solutions for connections administrators
 
XPages: No Experience Needed
XPages: No Experience NeededXPages: No Experience Needed
XPages: No Experience Needed
 
What's New in Notes, Sametime and Verse On-Premises
What's New in Notes, Sametime and Verse On-PremisesWhat's New in Notes, Sametime and Verse On-Premises
What's New in Notes, Sametime and Verse On-Premises
 
8 Tools for Troubleshooting Windows 8
8 Tools for Troubleshooting Windows 8 8 Tools for Troubleshooting Windows 8
8 Tools for Troubleshooting Windows 8
 
Web Performance First Aid
Web Performance First AidWeb Performance First Aid
Web Performance First Aid
 
Best and worst practices deploying IBM Connections
Best and worst practices deploying IBM ConnectionsBest and worst practices deploying IBM Connections
Best and worst practices deploying IBM Connections
 
Transformations: Smart Application Migration to XPages
Transformations: Smart Application Migration to XPagesTransformations: Smart Application Migration to XPages
Transformations: Smart Application Migration to XPages
 

Similar to Life in the Fast Lane: Full Speed XPages!, #dd13

La vita nella corsia di sorpasso; A tutta velocità, XPages!
La vita nella corsia di sorpasso; A tutta velocità, XPages!La vita nella corsia di sorpasso; A tutta velocità, XPages!
La vita nella corsia di sorpasso; A tutta velocità, XPages!Ulrich Krause
 
Life In The FastLane: Full Speed XPages
Life In The FastLane: Full Speed XPagesLife In The FastLane: Full Speed XPages
Life In The FastLane: Full Speed XPagesUlrich Krause
 
Life in the fast lane. Full speed XPages
Life in the fast lane. Full speed XPagesLife in the fast lane. Full speed XPages
Life in the fast lane. Full speed XPagesUlrich Krause
 
node.js 실무 - node js in practice by Jesang Yoon
node.js 실무 - node js in practice by Jesang Yoonnode.js 실무 - node js in practice by Jesang Yoon
node.js 실무 - node js in practice by Jesang YoonJesang Yoon
 
(ATS6-PLAT06) Maximizing AEP Performance
(ATS6-PLAT06) Maximizing AEP Performance(ATS6-PLAT06) Maximizing AEP Performance
(ATS6-PLAT06) Maximizing AEP PerformanceBIOVIA
 
Intro to XPages for Administrators (DanNotes, November 28, 2012)
Intro to XPages for Administrators (DanNotes, November 28, 2012)Intro to XPages for Administrators (DanNotes, November 28, 2012)
Intro to XPages for Administrators (DanNotes, November 28, 2012)Per Henrik Lausten
 
Developing High Performance Web Apps - CodeMash 2011
Developing High Performance Web Apps - CodeMash 2011Developing High Performance Web Apps - CodeMash 2011
Developing High Performance Web Apps - CodeMash 2011Timothy Fisher
 
071410 sun a_1515_feldman_stephen
071410 sun a_1515_feldman_stephen071410 sun a_1515_feldman_stephen
071410 sun a_1515_feldman_stephenSteve Feldman
 
Day 7 - Make it Fast
Day 7 - Make it FastDay 7 - Make it Fast
Day 7 - Make it FastBarry Jones
 
"You Don't Know NODE.JS" by Hengki Mardongan Sihombing (Urbanhire)
"You Don't Know NODE.JS" by Hengki Mardongan Sihombing (Urbanhire)"You Don't Know NODE.JS" by Hengki Mardongan Sihombing (Urbanhire)
"You Don't Know NODE.JS" by Hengki Mardongan Sihombing (Urbanhire)Tech in Asia ID
 
Getting Started with JDK Mission Control
Getting Started with JDK Mission ControlGetting Started with JDK Mission Control
Getting Started with JDK Mission ControlMarcus Hirt
 
Functional? Reactive? Why?
Functional? Reactive? Why?Functional? Reactive? Why?
Functional? Reactive? Why?Aleksandr Tavgen
 
Machine Learning With H2O vs SparkML
Machine Learning With H2O vs SparkMLMachine Learning With H2O vs SparkML
Machine Learning With H2O vs SparkMLArnab Biswas
 

Similar to Life in the Fast Lane: Full Speed XPages!, #dd13 (20)

La vita nella corsia di sorpasso; A tutta velocità, XPages!
La vita nella corsia di sorpasso; A tutta velocità, XPages!La vita nella corsia di sorpasso; A tutta velocità, XPages!
La vita nella corsia di sorpasso; A tutta velocità, XPages!
 
Life In The FastLane: Full Speed XPages
Life In The FastLane: Full Speed XPagesLife In The FastLane: Full Speed XPages
Life In The FastLane: Full Speed XPages
 
Life in the fast lane. Full speed XPages
Life in the fast lane. Full speed XPagesLife in the fast lane. Full speed XPages
Life in the fast lane. Full speed XPages
 
XPages Performance
XPages PerformanceXPages Performance
XPages Performance
 
Fastest Servlets in the West
Fastest Servlets in the WestFastest Servlets in the West
Fastest Servlets in the West
 
node.js 실무 - node js in practice by Jesang Yoon
node.js 실무 - node js in practice by Jesang Yoonnode.js 실무 - node js in practice by Jesang Yoon
node.js 실무 - node js in practice by Jesang Yoon
 
Salesforce Performance hacks - Client Side
Salesforce Performance hacks - Client SideSalesforce Performance hacks - Client Side
Salesforce Performance hacks - Client Side
 
(ATS6-PLAT06) Maximizing AEP Performance
(ATS6-PLAT06) Maximizing AEP Performance(ATS6-PLAT06) Maximizing AEP Performance
(ATS6-PLAT06) Maximizing AEP Performance
 
Drupal performance
Drupal performanceDrupal performance
Drupal performance
 
Intro to XPages for Administrators (DanNotes, November 28, 2012)
Intro to XPages for Administrators (DanNotes, November 28, 2012)Intro to XPages for Administrators (DanNotes, November 28, 2012)
Intro to XPages for Administrators (DanNotes, November 28, 2012)
 
Developing High Performance Web Apps - CodeMash 2011
Developing High Performance Web Apps - CodeMash 2011Developing High Performance Web Apps - CodeMash 2011
Developing High Performance Web Apps - CodeMash 2011
 
071410 sun a_1515_feldman_stephen
071410 sun a_1515_feldman_stephen071410 sun a_1515_feldman_stephen
071410 sun a_1515_feldman_stephen
 
Day 7 - Make it Fast
Day 7 - Make it FastDay 7 - Make it Fast
Day 7 - Make it Fast
 
"You Don't Know NODE.JS" by Hengki Mardongan Sihombing (Urbanhire)
"You Don't Know NODE.JS" by Hengki Mardongan Sihombing (Urbanhire)"You Don't Know NODE.JS" by Hengki Mardongan Sihombing (Urbanhire)
"You Don't Know NODE.JS" by Hengki Mardongan Sihombing (Urbanhire)
 
Getting Started with JDK Mission Control
Getting Started with JDK Mission ControlGetting Started with JDK Mission Control
Getting Started with JDK Mission Control
 
Autosar Basics hand book_v1
Autosar Basics  hand book_v1Autosar Basics  hand book_v1
Autosar Basics hand book_v1
 
Functional? Reactive? Why?
Functional? Reactive? Why?Functional? Reactive? Why?
Functional? Reactive? Why?
 
01 oracle architecture
01 oracle architecture01 oracle architecture
01 oracle architecture
 
Machine Learning With H2O vs SparkML
Machine Learning With H2O vs SparkMLMachine Learning With H2O vs SparkML
Machine Learning With H2O vs SparkML
 
XPages Performance Master Class - Survive in the fast lane on the Autobahn (E...
XPages Performance Master Class - Survive in the fast lane on the Autobahn (E...XPages Performance Master Class - Survive in the fast lane on the Autobahn (E...
XPages Performance Master Class - Survive in the fast lane on the Autobahn (E...
 

More from Dominopoint - Italian Lotus User Group

IBM Connections How to use existing data to increase adoption success with IB...
IBM Connections How to use existing data to increase adoption success with IB...IBM Connections How to use existing data to increase adoption success with IB...
IBM Connections How to use existing data to increase adoption success with IB...Dominopoint - Italian Lotus User Group
 

More from Dominopoint - Italian Lotus User Group (20)

TOTP - Time-Based One Time password in Domino
TOTP - Time-Based One Time password in DominoTOTP - Time-Based One Time password in Domino
TOTP - Time-Based One Time password in Domino
 
Domino Backup V12 - Un nuovo Task
Domino Backup V12 - Un nuovo TaskDomino Backup V12 - Un nuovo Task
Domino Backup V12 - Un nuovo Task
 
Mail Client from Traveler to Verse On-Premises
Mail Client from Traveler to Verse On-PremisesMail Client from Traveler to Verse On-Premises
Mail Client from Traveler to Verse On-Premises
 
IBM Worspace: Towards a culture of conversations
IBM Worspace: Towards a culture of conversationsIBM Worspace: Towards a culture of conversations
IBM Worspace: Towards a culture of conversations
 
Microsoft Outlook for Domino (IMSMO)
Microsoft Outlook for Domino (IMSMO)Microsoft Outlook for Domino (IMSMO)
Microsoft Outlook for Domino (IMSMO)
 
Riding the Enterprise Integration train
Riding the Enterprise Integration trainRiding the Enterprise Integration train
Riding the Enterprise Integration train
 
Ortocloud l'applicazione per fare orto su Bluemix
Ortocloud l'applicazione per fare orto su BluemixOrtocloud l'applicazione per fare orto su Bluemix
Ortocloud l'applicazione per fare orto su Bluemix
 
Meetit16 KeyNote di Apertura
Meetit16 KeyNote di AperturaMeetit16 KeyNote di Apertura
Meetit16 KeyNote di Apertura
 
IBM Domino Modernizing apps with Angularjs
IBM Domino Modernizing apps with AngularjsIBM Domino Modernizing apps with Angularjs
IBM Domino Modernizing apps with Angularjs
 
IBM Connections How to use existing data to increase adoption success with IB...
IBM Connections How to use existing data to increase adoption success with IB...IBM Connections How to use existing data to increase adoption success with IB...
IBM Connections How to use existing data to increase adoption success with IB...
 
Cloudant e XPages
Cloudant e XPagesCloudant e XPages
Cloudant e XPages
 
IBM Bluemix
IBM BluemixIBM Bluemix
IBM Bluemix
 
IBM Connections 10 things every user should know
IBM Connections 10 things every user should knowIBM Connections 10 things every user should know
IBM Connections 10 things every user should know
 
IBM Verse New Way To Work
IBM Verse New Way To WorkIBM Verse New Way To Work
IBM Verse New Way To Work
 
Crossware MailSignature
Crossware MailSignatureCrossware MailSignature
Crossware MailSignature
 
Cooperteam soluzioni
Cooperteam soluzioniCooperteam soluzioni
Cooperteam soluzioni
 
Notes and Domino Roadmap
Notes and Domino RoadmapNotes and Domino Roadmap
Notes and Domino Roadmap
 
La Collaborazione Europea
La Collaborazione EuropeaLa Collaborazione Europea
La Collaborazione Europea
 
the future of work
the future of workthe future of work
the future of work
 
Dominopoint meet the experts 2015 - XPages
Dominopoint   meet the experts 2015 - XPagesDominopoint   meet the experts 2015 - XPages
Dominopoint meet the experts 2015 - XPages
 

Recently uploaded

Human Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsHuman Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsMark Billinghurst
 
Advanced Computer Architecture – An Introduction
Advanced Computer Architecture – An IntroductionAdvanced Computer Architecture – An Introduction
Advanced Computer Architecture – An IntroductionDilum Bandara
 
Unleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubUnleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubKalema Edgar
 
Gen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfGen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfAddepto
 
Powerpoint exploring the locations used in television show Time Clash
Powerpoint exploring the locations used in television show Time ClashPowerpoint exploring the locations used in television show Time Clash
Powerpoint exploring the locations used in television show Time Clashcharlottematthew16
 
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage Cost
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage CostLeverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage Cost
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage CostZilliz
 
Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024Enterprise Knowledge
 
Artificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptxArtificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptxhariprasad279825
 
SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024Lorenzo Miniero
 
The Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and ConsThe Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and ConsPixlogix Infotech
 
How to write a Business Continuity Plan
How to write a Business Continuity PlanHow to write a Business Continuity Plan
How to write a Business Continuity PlanDatabarracks
 
"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii SoldatenkoFwdays
 
TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024Lonnie McRorey
 
DevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache MavenDevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache MavenHervé Boutemy
 
Take control of your SAP testing with UiPath Test Suite
Take control of your SAP testing with UiPath Test SuiteTake control of your SAP testing with UiPath Test Suite
Take control of your SAP testing with UiPath Test SuiteDianaGray10
 
Story boards and shot lists for my a level piece
Story boards and shot lists for my a level pieceStory boards and shot lists for my a level piece
Story boards and shot lists for my a level piececharlottematthew16
 
CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):comworks
 
WordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your BrandWordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your Brandgvaughan
 
Hyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdf
Hyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdfHyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdf
Hyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdfPrecisely
 

Recently uploaded (20)

Human Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsHuman Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR Systems
 
Advanced Computer Architecture – An Introduction
Advanced Computer Architecture – An IntroductionAdvanced Computer Architecture – An Introduction
Advanced Computer Architecture – An Introduction
 
Unleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubUnleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding Club
 
Gen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfGen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdf
 
Powerpoint exploring the locations used in television show Time Clash
Powerpoint exploring the locations used in television show Time ClashPowerpoint exploring the locations used in television show Time Clash
Powerpoint exploring the locations used in television show Time Clash
 
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage Cost
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage CostLeverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage Cost
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage Cost
 
Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024
 
Artificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptxArtificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptx
 
SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024
 
The Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and ConsThe Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and Cons
 
How to write a Business Continuity Plan
How to write a Business Continuity PlanHow to write a Business Continuity Plan
How to write a Business Continuity Plan
 
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptxE-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
 
"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko
 
TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024
 
DevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache MavenDevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache Maven
 
Take control of your SAP testing with UiPath Test Suite
Take control of your SAP testing with UiPath Test SuiteTake control of your SAP testing with UiPath Test Suite
Take control of your SAP testing with UiPath Test Suite
 
Story boards and shot lists for my a level piece
Story boards and shot lists for my a level pieceStory boards and shot lists for my a level piece
Story boards and shot lists for my a level piece
 
CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):
 
WordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your BrandWordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your Brand
 
Hyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdf
Hyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdfHyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdf
Hyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdf
 

Life in the Fast Lane: Full Speed XPages!, #dd13

  • 1. Ulrich Krause, Milano, 27 Settembre 2013 La vita nella corsia di sorpasso A tutta velocità, XPages!
  • 2. Life in the Fast Lane – Full Speed XPages! About: me Administrator /Developer since 1993 Senior Software Architect at BCC OpenNTF Contributor OpenNTF Board of Directors Blog http://www.eknori.de IBM Champion 2011/2012/2013 Notes Forum (http://www.atnotes.de)
  • 3. Life in the Fast Lane – Full Speed XPages! Agenda What factors affect Performance? Java vs. JavaScript ViewNavigator vs. GetNextDocument Stringbuilder vs. Concat (+) JSF Lifecycle Listener Partial Update / Partial Execute Variable Resolver Tools
  • 4. Life in the Fast Lane – Full Speed XPages! XPages Request
  • 5. Life in the Fast Lane – Full Speed XPages! Hardware The hardware used has a significant influence on performance. There are 3 key elements: • CPU • Main Memory • Hard Disk
  • 6. Life in the Fast Lane – Full Speed XPages! Hardware Main Memory • Limit defined by the operating system •  Scalability CPU • Cores / Clock / Cache •  Poor response time Weak CPU AND Low Memory • Poor overall performance • Poor response times • Server "hangs"
  • 7. Life in the Fast Lane – Full Speed XPages! Network Latency • Time taken for data transmission between multiple computers on a network Bandwidth • Rate of transmission of data Greater Bandwidth + Lower Latency -------------------------------= Better Connection
  • 8. Life in the Fast Lane – Full Speed XPages! Client & Browser Hardware How many data requests / responses are transmitted How much data is transferred (size) Caching of resources How much CSJS runs Size / complexity of the CSS Complexity of the site structure
  • 9. Life in the Fast Lane – Full Speed XPages! Limiting factors on performance Browser / HTTP server • Network latency – distance/time to server. • Bandwidth – size of files. • Browser limits on concurrent downloads • IE7 allows 2 downloads, IE8 allows 6 HTTP Server / App Server • HTTP Server JVM heap size & garbage collector • CPU time, competition between threads, gives slower response times • Threads, limited to 40 by default
  • 10. Life in the Fast Lane – Full Speed XPages! Limiting factors on performance App Server / Domino context • Read design elements from the NSF (XPage .class files, form structure, etc) • Backend API calls may be expensive, especially for large data sets. • Design elements may be network requests.
  • 11. Life in the Fast Lane – Full Speed XPages! Limiting factors on performance Servlet / Lifecycle • Restore control tree – file system read. Control tree locking – no concurrent access. • Rendered re-evaluated for every control for most phases Browser/Client JavaScript/Dojo • Inline JavaScript blocks insertion of later HTML elements into the DOM tree • Dojo does AJAX requests for .js files for dojo modules that are not loaded
  • 12. Life in the Fast Lane – Full Speed XPages! General Performance Options notes.ini • HTTPJVMMaxHeapSizeSet=1 • HTTPJVMMaxHeapSize=256M • Should be set to ¼ of the available RAM Domino Administrator • HTTP server "Enable logging to" disabled • HTTP server thread count – defaults to 40 Remember, enabling the debugger affects performance • JavaEnableDebug=1 • JavaDebugOptions=transport=dt_socket,server=y,suspend=n,address=8000 • JavascriptEnableDebug=1
  • 13. Life in the Fast Lane – Full Speed XPages! Reducing Memory Utilization xsp.persistence.mode= • Defines the persistence mode for the JSF pages • file: All the pages are persisted on disk • fileex: All the pages are persisted on disk except the current one, which stays in memory • <else>: All the pages stay in memory (tree mode)
  • 14. Life in the Fast Lane – Full Speed XPages! XPages Design Optimizations Use Simple actions vs links or button with window.location JS Reduce server phase processing • Use partial update where possible • Use partial execute where possible • Use disableValidators & immediate event Minimize work in rendered / visible computations • Use variable resolver When using Repeats & Views • Use viewEntry.getColumnValue instead of viewEntry.getDocument.getColumn • Use Domino View data source dataCache property where possible
  • 15. Life in the Fast Lane – Full Speed XPages! XPages Design Optimizations Load-time vs Runtime • Using loaded vs rendered • ExtLib Dynamic Content • allows partial re-loading, so more use of load-time optimizations Loading resources in the browser • CSS & browser JS • extract to separate files. Minify & compress files • Images • use correct size & format. Use CSS Image Sprites as possible
  • 16. Life in the Fast Lane – Full Speed XPages! JavaScript/CSS Aggregation Groups many DOJO, CSS / JS files into a single file • • • • Less requests from the browser to the server Performance improvements on networks with high latency Enhanced performance parsing CSS / JS Fewer connections to the server On the Server: xsp.properties: xsp.resources.aggregate=true
  • 17. Life in the Fast Lane – Full Speed XPages! JavaScript/CSS Aggregation
  • 18. Life in the Fast Lane – Full Speed XPages! XPages PreLoad XPagesPreload=1 New Feature in Notes / Domino 8.5.3 Works on Server and Client Java classes from the XPages runtime plug-ins loaded from a fixed list of runtime classes ( 435 in ND 8.5.3 ) • com.ibm.xsp.core, common utility, JS wrapper, FSF runtime classes Java classes referenced in *-faces.config.xml • XPages control renderer, data sources, complex types
  • 19. Life in the Fast Lane – Full Speed XPages! XPages PreLoad XPagesPreloadDB = Server!!Db.nsf/XPage.xsp, myLocalDb.nsf Works at the application level The application is loaded on the client / server startup into memory. • This happens even when the application is first opened in the browser
  • 20. Life in the Fast Lane – Full Speed XPages! XPages PreLoad (cont.) For each entry in the notes.ini variable, an XPage URL is generated and sent to the server The application is loaded, and the HTML generated The XPages runtime discards the HTML, but retains the application in memory
  • 21. Life in the Fast Lane – Full Speed XPages! Scoped Variables applicationScope • Are visible for all users of one application. • Expires some time after the last user used an applicationScope variable. • applicationScope variables are NOT persistent forever. sessionScope • Is valid through the session of the current user. • A user session expires after some time of inactivity. • Uses don't have access to the sessionScope variables of other users.
  • 22. Life in the Fast Lane – Full Speed XPages! Scoped Variables (cont.) viewScope • Is visible for views on the current page only. • Useful for transporting a search query to a view. requestScope • Is valid through one request of the current user. • That includes refreshing of a page.
  • 23. Life in the Fast Lane – Full Speed XPages! Caching with Application Scope
  • 24. Life in the Fast Lane – Full Speed XPages! JSF Lifecycle
  • 25. Life in the Fast Lane – Full Speed XPages! XPages Lifecycle Listener What happens in each phase of the JSF lifecycle? Ulrich Krause: http://openntf.org/XSnippets.nsf/snippet.xsp?id=a-simple-lifecyclelistener-
  • 26. Life in the Fast Lane – Full Speed XPages! XPages Masterclass http://www.openntf.org/internal/home.nsf/project.xsp?action=openDocument&name=XPages%20Masterclass
  • 27. Life in the Fast Lane – Full Speed XPages! When to Execute - # vs $ # • Executed every time the page is rendered • Use for values that are likely to change $ • Executed when the page is first loaded • Use for values that don't change
  • 28. Life in the Fast Lane – Full Speed XPages! DataContext Can be thought of as global variables Value can be computed dynamically or on page load • You can use ${javascript:@Today()} and run it once rather than running a function each time. Can be scoped to any level that datasources can • XPage, Custom Control or Panel • Set a dataContext in a panel in a repeat control to avoid multiple references to a NotesDocument's item Is Referenced using EL • At no point in the references do you run SSJS • Not having to go through the SSJS parser
  • 29. Life in the Fast Lane – Full Speed XPages! DataContext - Pitfall Do not bind data context variables dynamically. • They will be recomputed again and again, even when in partial execution mode and if they are not in use
  • 30. Life in the Fast Lane – Full Speed XPages! DataContext - Pitfall
  • 31. Life in the Fast Lane – Full Speed XPages! Partial Refresh / Update (Pro) Reduced control processing in the render response phase • Means less work on the server • RenderResponse is the most intensive phase Smaller response from server. • Means reduced network usage Better browser experience • Rest of the page is still visible while waiting for a response • Inserting small sections into the page is much faster than reloading a full page.
  • 32. Life in the Fast Lane – Full Speed XPages! Partial Refresh / Update (Cons) Dependancy outside of the partial update area • Other areas of the control tree are not processed,so any SSJS scripts in those other controls will not be run. • Enabling Partial Update where it was previously full update may lead to functional problems Only one area may be partial updated by default • In CSJS you can schedule later partial updates of related areas, but any concurrent requests will wait for exclusive access to the server-side control tree before processing on the server http://www.timtripcony.com/blog.nsf/d6plinks/TTRY-84B6VP
  • 33. Life in the Fast Lane – Full Speed XPages! Partial Refresh / Update (Cons) Refreshing more than one target ID in a single partial refresh event • http://www.timtripcony.com/blog.nsf/d6plinks/TTRY-84B6VP
  • 34. Life in the Fast Lane – Full Speed XPages! Partial Execution Reduced processing in the 3 data-processing phases • Means less work on the server, faster response times Dependancy on Edit Box values outside of the exec area • Submitted values from Edit Boxes and/or other input controls in other areas of the control tree are not processed, so any control values and document fields in those other areas will not be updated. • Enabling Partial Exec where it was previously full execution may lead to functional problems where values are out-of date in the onclick script or in the redisplayed page.
  • 35. Life in the Fast Lane – Full Speed XPages! Partial Execution (cont.) onclick Event Handler must be in the exec area • The ApplyRequestValues phase prepares for the invokeApplication phase. • The onclick simple action or SSJS script won't occur if outside the partial exec area
  • 36. Life in the Fast Lane – Full Speed XPages! Partial Execution execMode added in 8.5.1 (not in 8.5.0) execId slightly difficult to select in Designer • Select your button, in the Outline view, toggle open the button, select the child Event Handler control, then set the execId property on the Event Handler. • [Better UI proposed in Notes/Domino Next – in the Events tab]
  • 37. Life in the Fast Lane – Full Speed XPages! disableValidators / immediate disableValidators • • • • JSF life cycle through all phases (1-6) But requests will not validate the data Converters continue to work. Items in documents will be updated Immediate • • • • JSF Lifecycle processes only phases (1, 2, 6) No data processing Items in documents are not updated Onclick event handler scripts and render response calculations are performed
  • 38. Life in the Fast Lane – Full Speed XPages! Minimize work in rendered/ visible computation like CSS “style” are only computed in Most properties, the RenderResponse phase Edit Box and input “value” properties are used in Data Processing phases and RenderResponse phase Data Source properties are computed during RenderResponse • Results are cached for the next request's Data Processing and InvokeApplication phases
  • 39. Life in the Fast Lane – Full Speed XPages! Minimize work in rendered / visible computationproperty is computed in all 5 lifecycle The rendered phases Avoid re-computing values in every rendered property • @DbLookup, @DbColumn, getDocumentByKey • In the rendered property, save the computed boolean to a viewScope variable
  • 40. Life in the Fast Lane – Full Speed XPages! Using loaded vs rendered Loaded • is only computed once in the createView phase • not re-computed in the other phases • false means the control is not created, so it can never be rendered. • true means the control is added to the control tree. • You can still compute rendered when loaded evaluates to true. Compute the loaded property on conditions • where you could compute the rendered property and save it to the view scope. It would never need to be recomputed for the rest of the interaction with this page
  • 41. Life in the Fast Lane – Full Speed XPages! Images Use correct file type depending on content • JPEG for complex and detailed images • PNG/GIF for simple images, fonts, transparencies • Use the HTML <img> tag “width” and “height” attributes For faster HTML layout in the browser • Size the image to size you intend to use • Resizing using html attributes height and width will delay the rendering of your page • Images larger than necessary will waste bandwidth
  • 42. Life in the Fast Lane – Full Speed XPages! Image Sprites Use CSS Image Sprites • If you have multiple small images, make a single larger image containing the smaller images • Use CSS to display only the relevant subset image at a location in the page • For semantically significant sprites, provide an accessibility “title” attribut (as sprites don't use the IMG “alt” attribute, but you still want to assist blind users) • There's no specific XPages support for sprites, but they're used in the XPages OneIU themes
  • 43. Life in the Fast Lane – Full Speed XPages! CSS Image Sprite Sample http://www.w3schools.com/css/tryit.asp?filename=trycss_sprites_img
  • 44. Life in the Fast Lane – Full Speed XPages! XPages Toolbox XPages based Application • Runs on the Domino server or the Notes client • An NSF needs to be installed on the server/Notes client • A profiler jar file should be added to the JVM launch options Measures CPU performance and memory allocation Available from OpenNTF.org • Free open source project • http://www.openntf.org/internal/home.nsf/project.xsp?action=openDocu ment&name=XPages%20Toolbox Extended in 8.5.2 to support backend classes profiling
  • 45. Life in the Fast Lane – Full Speed XPages! XPages Toolbox
  • 46. Life in the Fast Lane – Full Speed XPages! XPages Toolbox Generate a heap dump of the JVM running in the HTTP task • A button in the XPages profiler generates the heap dump • From the Domino console • tell http xsp heapdump (triggers com.ibm.jvm.Dump.HeapDump()) • tell http xsp javadump (triggers com.ibm.jvm.Dump.JavaDump()) Analyze the heap dump using the Eclipse memory analyzer • http://www.eclipse.org/mat/ • http://www.ibm.com/developerworks/java/jdk/tools/dtfj.html
  • 47. Life in the Fast Lane – Full Speed XPages! Heapdump / Javadump Analyzer
  • 48. Life in the Fast Lane – Full Speed XPages! More Tools Print statements • In rendered/visible computations to see how often executed • print("panel2 evaluating rendered property"); • In the XPages root control events: • before/afterPageLoad, afterRestoreView, before/afterRenderResponse. • Custom control root events: • before/afterPageLoad. • In the document data source events: • queryNewDocument, postSaveDocument, etc. Task Manager and/or Process Explorer • Shows CPU usage & process memory usage as it happens
  • 49. Life in the Fast Lane – Full Speed XPages! More Tools Browser developer tools • for watching network transactions, partial updates, response times • BROWSER: Firebug, Developer Tools • XPiNC: FirebugLite from ExtLib Java / Javascript Debugging • Degrades performance but can inspect objectsUse the Eclipse Java debugger. • In Dominonotes.ini add these 2 options: • JavaEnableDebug=1 • JavaDebugOptions=transport=dt_socket,server=y,suspend=n,address=8000
  • 50. Life in the Fast Lane – Full Speed XPages! Optimization – Step By Step
  • 51. Life in the Fast Lane – Full Speed XPages! XAgent – SSJS Get all „Contacts“ into a NotesDocumentCollection, loop the collection and build the JSON by reading the values from items in the document
  • 52. Life in the Fast Lane – Full Speed XPages! XAgent – SSJS
  • 53. Life in the Fast Lane – Full Speed XPages! XAgent – SSJS – UNID from Item Get all „Contacts“ into a NotesDocumentCollection, loop the collection and build the JSON by reading the values from items in the document. Also UNID is stored in document
  • 54. Life in the Fast Lane – Full Speed XPages! XAgent – SSJS – UNID from Item
  • 55. Life in the Fast Lane – Full Speed XPages! XAgent – SSJS - SingleItem Get all „Contacts“ into a NotesDocumentCollection, loop the collection and get the JSON from an item on the document. JSON is calculated on document save
  • 56. Life in the Fast Lane – Full Speed XPages! XAgent – SSJS - SingleItem
  • 57. Life in the Fast Lane – Full Speed XPages! XAgent – SSJS – ViewNavigator loop thru a view and get the JSON from a view column.
  • 58. Life in the Fast Lane – Full Speed XPages! XAgent – SSJS – ViewNavigator
  • 59. Life in the Fast Lane – Full Speed XPages! StringBuilder vs String.concat Concatenation of Strings is very easy in Java - all you need is a '+‘ Each time you append something via '+' (String.concat()) a new String is created, the old stuff is copied, the new stuff is appended, and the old String is thrown away. The bigger the String gets the longer it takes - there is more to copy and more garbage is produced. Accordingly to Arno Unkrig the optimal strategy is to use String.concat() for 2 or 3 operands, and StringBuilder for 4 or more operands
  • 60. Life in the Fast Lane – Full Speed XPages! StringBuilder vs String.concat When to use StringBuilder over '+' (String.concat()) ? • use StringBuilder whenever you assemble a String in a loop • Keep in mind that '+' isn't always a good idea http://kaioa.com/node/59
  • 61. Life in the Fast Lane – Full Speed XPages! XAgent – SSJS – ViewNavigator + StringBuilder and get the JSON from a view column. loop thru a view Use a StringBuilder to concat the JSON
  • 62. Life in the Fast Lane – Full Speed XPages! XAgent – SSJS – ViewNavigator + StringBuilder
  • 63. Life in the Fast Lane – Full Speed XPages! XAgent – Java loop thru a view and get the JSON from a view column. Use a StringBuilder to concat the JSON + use Java instead of SSJS
  • 64. Life in the Fast Lane – Full Speed XPages! XAgent – Java
  • 65. Life in the Fast Lane – Full Speed XPages! Themes Single document containing references to all your CSS resources • resource sections reference the CSS files • control section define what CSS classes are applied to specific controls XML based and easy To learn • creating a new theme document prefills sample content Can extend other themes • <theme extends="webstandard"> • will automatically include all the resource and control definitions from that theme
  • 66. Life in the Fast Lane – Full Speed XPages! Themes Create your own themes from scratch. • Extending an existing theme will include extra stylesheets and styles that you might not need. Be prepared to spend more time writing css though
  • 67. Life in the Fast Lane – Full Speed XPages! Load Resources from Themes Global Application / Configuration properties