move your xpages applications to the fast lane

64
Move Your XPages Applications to the Fast Lane Tweet about this event And mention us: @Teamstudio @TLCCLTD October 15, 2015

Upload: teamstudio

Post on 09-Jan-2017

1.332 views

Category:

Technology


1 download

TRANSCRIPT

Page 1: Move Your XPages Applications to the Fast Lane

Move Your XPages Applications to the Fast Lane

Tweet about this event

And mention us: @Teamstudio @TLCCLTD

October 15, 2015

Page 2: Move Your XPages Applications to the Fast Lane

@Teamstudio

teamstudio.com

@TLCCLTD

tlcc.com

Courtney CarterMarketing Associate

Teamstudio

Page 3: Move Your XPages Applications to the Fast Lane

Who We Are

• Manage, modernize, and mobilize your business

applications with software and solutions from

Teamstudio.

o Easy-to-use tools for developers and administrators

o Modernization Services to help you mobilize your

applications

o Mobilization platform for those who want to mobilize using

their own internal resources

• 1600+ active customers, 53 countries

• Offices in US, UK, and Japan

Page 4: Move Your XPages Applications to the Fast Lane

Teamstudio Unplugged

• Your mobile Domino server:

take your IBM Notes apps with you!

• End-users access Notes applications from mobile

devices whether online or offline

• Leverages the powerful technology of XPages

Page 5: Move Your XPages Applications to the Fast Lane

Unplugged Templates

• ContinuityMobile offline access to BCM programs

• OneView ApprovalsExpense approvals; anywhere, anytime

• CustomerViewLightweight CRM framework for field sales and field service teams• Contacts – customer information database

• Activities – customer activity log

• Media – mobile offline file storage and access

Page 6: Move Your XPages Applications to the Fast Lane

• Set of controls for IBM Domino developers

working on XPages apps and on Notes app

modernization projects

• Re-write of the Teamstudio Unplugged

Controls project, but adds full support for

PC browser-based user interfaces as well as

mobile interfaces

• Enables XPages developers to create

controls that are responsive

• Learn more:

teamstudio.com/solutions/xfoundations/xc

ontrols

XControls

Page 7: Move Your XPages Applications to the Fast Lane

Teamstudio Services

• Professional services for modernization, Web

enablement, project management, development,

and administrationo Modernization Services

o Developer Assistance Program

o Application Upgrade Analysis

o Application Complexity Analysis

o Application Usage Auditing

• http://www.teamstudio.com/solutions/services/

Page 8: Move Your XPages Applications to the Fast Lane

• XControls Business Edition promotion:

o Be entered to win an Apple iPad mini when you sign up to demo XControls Business

Edition before Oct. 31, 2015.

• XControls webinar: Nov. 3

Page 9: Move Your XPages Applications to the Fast Lane

Move your XPages Applications to the Fast Lane

1

Are your XPages Apps are like this???

Page 10: Move Your XPages Applications to the Fast Lane

Your Presenter Today – Howard Greenberg

• Certified Lotus Instructor since R3

• Co-founded TLCC in 1987

• IBM Champion

• Prior to that 12 years at IBM in the PC group

• Also…

– Certified Public Accountant

– Certified Information Systems Auditor (CISA)

– Certified Flight Instructor

2

Page 11: Move Your XPages Applications to the Fast Lane

How can TLCC Help YOU!

3

• Private classes at your location or virtual

•XPages Development

•Support Existing Apps

•Administration

• Let us help you become an expert XPages developer!

• Delivered via Notes

• XPages

• Development

• Admin

• UserSelf-

Paced Courses

Mentoring

Instructor-Led

Classes

Application Development

and Consulting

Free Demo

Courses!

Page 12: Move Your XPages Applications to the Fast Lane

4

• Save hundreds and even Thousands of Dollars on the most popular courses and packages:XPages DevelopmentNotes and Domino DevelopmentDomino Administration

• Now extended through October 30th

http://www.tlcc.com/fallsale

Page 13: Move Your XPages Applications to the Fast Lane

Upcoming and Recorded Webinars

5

www.tlcc.com/xpages-webinar

View Previous Webinars(use url above)

• Ask The XPages Experts– November 17

Page 14: Move Your XPages Applications to the Fast Lane

IBM Champion Nominations are Open

• Nominations are open for the IBM Champion program

– Through October 31st

– Go here to complete the nomination form

• If you think someone has contributed to the ICS community then nominate them!

– Speaks at conferences

– Helps out in forums and Stack Overflow, etc.

– Hosts videos, blogs, webinars

– More about the IBM Champion Program here

6

Page 15: Move Your XPages Applications to the Fast Lane

Asking Questions – Q and A at the end

7

Use the Orange Arrow button to expand the GoToWebinar panel

Then ask your questions in the Questions pane!

We will answer your questions verbally at the end of the webinar

Page 16: Move Your XPages Applications to the Fast Lane

Agenda

• What affects XPages Peformance

• XPages Lifecycle

• Partial Refresh vs. Partial Execution

• Tools to Analyze Peformance

• Case Studies

• Questions???

8

Page 17: Move Your XPages Applications to the Fast Lane

What affects XPages Performance?

9

Client:BrowserOSCPUHard driveMemory

Network Speed and

Latency Server:HardwareOSApplication (Domino)

Page 18: Move Your XPages Applications to the Fast Lane

What’s Involved on the Server...

• Server HW and OS pass network request to Domino

• Domino networking and HTTP Task

• XPages runtime engine

– Restore state (might read from disk)

– Java code builds HTML, etc. that gets sent to browser

• Uses the JSF Lifecycle (more on this later)

• Calls Backend Domino objects if needed

• Domino passes response (HTML, CSS, JS, etc.) to OS and via network to client

10

Page 19: Move Your XPages Applications to the Fast Lane

Server Performance Variables

• Hardware– CPU, Network, Memory, and Hard Drive

• Operating System (Use 64 bit OS!)• Domino:

– Memory Settings• HTTPJVMMaxHeapSize• Use HTTPJVMMaxHeapSizeSet=1 to prevent

changes– Number of threads

• See this article from IBM– Encryption (HTTPS)

11

Page 20: Move Your XPages Applications to the Fast Lane

Optimizing Memory Utilization

• xsp.persistence.mode - Set in XSP Properties file

– 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)

12

Page 21: Move Your XPages Applications to the Fast Lane

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

13

On the Server: xsp.properties:xsp.resources.aggregate=true

Page 22: Move Your XPages Applications to the Fast Lane

XPages Lifecycle

14

Page 23: Move Your XPages Applications to the Fast Lane

JSF Life Cycle - Post

15

Restore View

•Restore component tree

•Events:

•afterRestoreView

Apply Request Values

•Copy data to Editable controls

Process Validations

•Validations

•Converters

Update Model Values

•Move values to data source

Invoke Application

•Application logic

•Events:

•onClientLoad (XPage, etc)

•on… events of button, etc.

Render Response

•Convert to HTML, etc.

•Events:

•beforeRenderReponse

•afterRenderResponse

Request

Response

Page 24: Move Your XPages Applications to the Fast Lane

Lifecycle1 XPage – Initial Page Load

16

Render Response

• Rendered property for id: label1

• Label property for id: label1

• Rendered property for id: inputText1

• Default value property for id: inputText1

• Rendered property for id: label2

• Rendered property for id: comboBox1

• values property for id: comboBox1

• values property for id: comboBox1

• Rendered property for id: computedField1

• Value property for id: computedField1

• Rendered property for id: computedField2

• Value property for id: computedField2

12 SSJS Calls

Page 25: Move Your XPages Applications to the Fast Lane

Lifecyle1 – Submit (Full Update)

Restore View Apply Request Values (8)

•Rendered property for id: label1

•Rendered property for id: inputText1

•Rendered property for id: inputText1

•Rendered property for id: label2

•Rendered property for id: comboBox1

•Rendered property for id: comboBox1

•Rendered property for id: computedField1

•Rendered property for id: computedField2

Process Validations (11)

•Rendered property for id: label1

•Rendered property for id: inputText1

•Rendered property for id: inputText1

•Validation for inputText1

•Default value property for id: inputText1

•Rendered property for id: label2

•Rendered property for id: comboBox1

•Rendered property for id: comboBox1

•values property for id: comboBox1

•Rendered property for id: computedField1

•Rendered property for id: computedField2

Update Model Values (8)

•Rendered property for id: label1

•Rendered property for id: inputText1

•Rendered property for id: inputText1

•Rendered property for id: label2

•Rendered property for id: comboBox1

•Rendered property for id: comboBox1

•Rendered property for id: computedField1

•Rendered property for id: computedField2

Invoke Application (1)

•OnClick event for id: button1

Render Response (11)

•Rendered property for id: label1

•Label property for id: label1

•Rendered property for id: inputText1

•Rendered property for id: label2

•Rendered property for id: comboBox1

•values property for id: comboBox1

•values property for id: comboBox1

•Rendered property for id: computedField1

•Value property for id: computedField1

•Rendered property for id: computedField2

•Value property for id: computedField239 SSJS Calls17

Page 26: Move Your XPages Applications to the Fast Lane

When to Execute - # vs $

• # is Compute dynamically– Executed every time the page is

rendered– Use for values that are likely to change

• $ is Compute on Page Load– Executed when the page is first loaded– Use for values that don't change

18

<xp:label id="label1">

<xp:this.value>

<![CDATA[#{javascript:return “My

Label”;}]]>

</xp:this.value>

</xp:label>

Page 27: Move Your XPages Applications to the Fast Lane

Lifecyle2 – Submit (Full Update) - On Page Load

19

Restore View Apply Request Values

•Rendered property for id: label1

•Rendered property for id: inputText1

•Rendered property for id: inputText1

•Rendered property for id: label2

•Rendered property for id: comboBox1

•Rendered property for id: comboBox1

•Rendered property for id: computedField1

•Rendered property for id: computedField2

Process Validations (2)

•Rendered property for id: label1

•Rendered property for id: inputText1

•Rendered property for id: inputText1

•Validation for inputText1

•Default value property for id: inputText1

•Rendered property for id: label2

•Rendered property for id: comboBox1

•Rendered property for id: comboBox1

•values property for id: comboBox1

•Rendered property for id: computedField1

•Rendered property for id: computedField2

Update Model Values

•Rendered property for id: label1

•Rendered property for id: inputText1

•Rendered property for id: inputText1

•Rendered property for id: label2

•Rendered property for id: comboBox1

•Rendered property for id: comboBox1

•Rendered property for id: computedField1

•Rendered property for id: computedField2

Invoke Application (1)

•OnClick event for id: button1

Render Response (3)

•Rendered property for id: label1

•Label property for id: label1

•Rendered property for id: inputText1

•Rendered property for id: label2

•Rendered property for id: comboBox1

•values property for id: comboBox1

•values property for id: comboBox1

•Rendered property for id: computedField1

•Value property for id: computedField1

•Rendered property for id: computedField2

•Value property for id: computedField26 SSJS Calls, saved 33

Changed all Rendered and Values (comboBox) to only compute on Page Load

Page 28: Move Your XPages Applications to the Fast Lane

Options for dynamically computing the Rendered:

• Scoped variables

– Still get calculated but do the heavy lifting once and then read the scoped variable in the Rendered property

• DataContexts

– Compute a value at the Xpage or Panel level once

– Refer to the value using EL (much faster than SSJS)

20

But I need dynamic Rendering!

Page 29: Move Your XPages Applications to the Fast Lane

DataContext - Pitfall

• Be careful binding data context variables dynamically

– They will be recomputed multiple times, even when in partial execution mode and if they are not in use (six times!)

• Apply Request Values

• Process Validations

• Update Model Values

• Invoke Application

• Twice in Render Response!

• If computed on page load then only computed once on page load

• See Paul Withers blog entry to learn how to set a data context value via code

21

Page 30: Move Your XPages Applications to the Fast Lane

Partial Refresh vs. Partial Execution?

• Partial Refresh (Update)

– Computes entire XPage, only sends back what is in the partial refresh id (refreshId)

• Partial Execution

– Only calculates what is in the area specified (execId)

22

Page 31: Move Your XPages Applications to the Fast Lane

Partial Refresh Demo - Results

23

Restore View Apply Request Values (8)

•Rendered property for id: label1

•Rendered property for id: inputText1

•Rendered property for id: inputText1

•Rendered property for id: label2

•Rendered property for id: comboBox1

•Rendered property for id: comboBox1

•Rendered property for id: computedField1

•Rendered property for id: computedField2

Process Validations (11)

•Rendered property for id: label1

•Rendered property for id: inputText1

•Rendered property for id: inputText1

•Validation for inputText1

•Default value property for id: inputText1

•Rendered property for id: label2

•Rendered property for id: comboBox1

•Rendered property for id: comboBox1

•values property for id: comboBox1

•Rendered property for id: computedField1

•Rendered property for id: computedField2

Update Model Values (8)

•Rendered property for id: label1

•Rendered property for id: inputText1

•Rendered property for id: inputText1

•Rendered property for id: label2

•Rendered property for id: comboBox1

•Rendered property for id: comboBox1

•Rendered property for id: computedField1

•Rendered property for id: computedField2

Invoke Application (1)

•OnClick event for id: button1

Render Response (2)

•Rendered property for id: label1

•Label property for id: label1

•Rendered property for id: inputText1

•Rendered property for id: label2

•Rendered property for id: comboBox1

•values property for id: comboBox1

•values property for id: comboBox1

•Rendered property for id: computedField1

•Value property for id: computedField1

•Rendered property for id: computedField2

•Value property for id: computedField230 SSJS Calls, saved 9

Only Savings were here!

Page 32: Move Your XPages Applications to the Fast Lane

Partial Refresh Pros and Cons

• Pros

– Reduced control processing in the render response phase

– Smaller response from server• Means reduced network usage

– Better UI experience• Rest of the page is still visible while waiting for a response

• Cons

– Controls like computed fields outside refresh area don’t refresh

– Be careful turning this on for a completed XPage (TEST!)

– Can only update one area (one id)

• Workaround from Tim Tripcony on XPages Wiki

24

Page 33: Move Your XPages Applications to the Fast Lane

Partial Execution Demo - Results

25

Restore View Apply Request Values (1)

•Rendered property for id: label1

•Rendered property for id: inputText1

•Rendered property for id: inputText1

•Rendered property for id: label2

•Rendered property for id: comboBox1

•Rendered property for id: comboBox1

•Rendered property for id: computedField1

•Rendered property for id: computedField2

Process Validations (1)

•Rendered property for id: label1

•Rendered property for id: inputText1

•Rendered property for id: inputText1

•Validation for inputText1

•Default value property for id: inputText1

•Rendered property for id: label2

•Rendered property for id: comboBox1

•Rendered property for id: comboBox1

•values property for id: comboBox1

•Rendered property for id: computedField1

•Rendered property for id: computedField2

Update Model Values (1)

•Rendered property for id: label1

•Rendered property for id: inputText1

•Rendered property for id: inputText1

•Rendered property for id: label2

•Rendered property for id: comboBox1

•Rendered property for id: comboBox1

•Rendered property for id: computedField1

•Rendered property for id: computedField2

Invoke Application (1)

•OnClick event for id: button1

Render Response (12)

•Rendered property for id: label1

•Label property for id: label1

•Rendered property for id: inputText1

•Default value property for id: inputText1

•Rendered property for id: label2

•Rendered property for id: comboBox1

•values property for id: comboBox1

•values property for id: comboBox1

•Rendered property for id: computedField1

•Value property for id: computedField1

•Rendered property for id: computedField2

•Value property for id: computedField2

16 SSJS CallsSaved 13

Page 34: Move Your XPages Applications to the Fast Lane

Partial Execution Pros and Cons

• Pros

– Reduced processing in the 3 data-processing phases

• Cons

– Control with onClick event has to be inside the execId area

– Editable values outside of the executed area do not get submitted/updated (reset to default values)

– Existing XPages need analysis/testing before using this

• Current onclick events might refer to controls where the data is not submitted

– ExecMode available in 8.5.1

– Have to use source to enter ExecId in 8.5 (9.0 has Designer UI)

26

Page 35: Move Your XPages Applications to the Fast Lane

Partial Refresh AND Execution Demo - Results

Restore View Apply Request Values (1)

•Rendered property for id: label1

•Rendered property for id: inputText1

•Rendered property for id: inputText1

•Rendered property for id: label2

•Rendered property for id: comboBox1

•Rendered property for id: comboBox1

•Rendered property for id: computedField1

•Rendered property for id: computedField2

Process Validations (1)

•Rendered property for id: label1

•Rendered property for id: inputText1

•Rendered property for id: inputText1

•Validation for inputText1

•Default value property for id: inputText1

•Rendered property for id: label2

•Rendered property for id: comboBox1

•Rendered property for id: comboBox1

•values property for id: comboBox1

•Rendered property for id: computedField1

•Rendered property for id: computedField2

Update Model Values (1)

•Rendered property for id: label1

•Rendered property for id: inputText1

•Rendered property for id: inputText1

•Rendered property for id: label2

•Rendered property for id: comboBox1

•Rendered property for id: comboBox1

•Rendered property for id: computedField1

•Rendered property for id: computedField2

Invoke Application (1)

•OnClick event for id: button1

Render Response (2)

•Rendered property for id: label1

•Label property for id: label1

•Rendered property for id: inputText1

•Rendered property for id: label2

•Rendered property for id: comboBox1

•values property for id: comboBox1

•values property for id: comboBox1

•Rendered property for id: computedField1

•Value property for id: computedField1

•Rendered property for id: computedField2

•Value property for id: computedField2

6 SSJS Calls, saved 33

27

Page 36: Move Your XPages Applications to the Fast Lane

Using the loaded Property

• Loaded = true– In component tree

• Loaded = false

– Control is not created

– Can never be rendered or accessed

– Saves memory too

28

Loaded only computed once in the createView phase

Page 37: Move Your XPages Applications to the Fast Lane

Life Cycle Performance Suggestions

• Most properties, like CSS “style” are only computed in the RenderResponse phase

• Watch and minimize:

– Rendered property (when dynamic)

• Computed multiple times!

• Use dataContexts or scoped variables when able

• Use both Partial Refresh (Update) and Partial Execute when able

29

Page 38: Move Your XPages Applications to the Fast Lane

Tools to Test/Debug Performance Issues

• Print statements

– In rendered/visible computations to see how often executed• print("panel2 evaluating rendered property");

– In the XPages events such as:

• before/afterPageLoad, afterRestoreView, before/afterRenderResponse

– In the document data source events:

• queryNewDocument, postSaveDocument, etc.

– Or use the Debug Toolbar (don‘t have to view server console)

• http://www.openntf.org/main.nsf/project.xsp?r=project/XPage%20Debug%20Toolbar

30

Page 39: Move Your XPages Applications to the Fast Lane

More Tools

• Server OS tools to monitor CPU, memory and network

• Browser developer tools

– for watching network transactions, partial updates, response times

– BROWSER: Firebug, Chrome, etc. developer tools

– XPiNC: FirebugLite from ExtLib

• Java / Javascript Debugging

– Degrades performance but can inspect objects

• Use the Eclipse Java debugger

31

Page 40: Move Your XPages Applications to the Fast Lane

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 is added to the JVM directory

– Modify the security policy file

– Notes.ini is modified (all in the documentation!)

• Measures CPU performance and memory allocation

• Available from OpenNTF.org

– Free open source project

– http://www.openntf.org/main.nsf/project.xsp?r=project/XPages%20Toolbox

32

Page 41: Move Your XPages Applications to the Fast Lane

XPages Toolbox Functionality

• Measures CPU and Wall time

• Back end Domino object profiling

• Run time monitor (memory)

• Session dumps (XML file)

• Heap dump of the JVM running in the HTTP task– Or from the Domino console (or from your code)

• 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 (need to also install the IBM dump tool)

http://www.eclipse.org/mat/

http://www.ibm.com/developerworks/java/jdk/tools/dtfj.html

• Thread Monitoring

33

Page 42: Move Your XPages Applications to the Fast Lane

CPU Profiler – See how long and where...

34

Page 43: Move Your XPages Applications to the Fast Lane

Back End (Domino) Profiler

35

Page 44: Move Your XPages Applications to the Fast Lane

Watch Out for @DbLookup

• @DbLookup about 3-4 times slower than SSJS– res = @DbLookup(db,"CustomersByNameView",names[i], "phone");

vs.– doc = vw.getDocumentByKey(names[i], true);

res = doc.getItemValueString("phone");

• Five lookups repeated 100 times

– @DbLookup averaged about 1728ms

– getDocumentByKey averaged 510ms

• Other @Functions not tested

36

Page 45: Move Your XPages Applications to the Fast Lane

• Simple Repeat – what could be wrong?

– Configuration Lookups to get other nsf names

– Lookups to get “role” of user

– Opening Notes document to get values

– Computed view value

– Complicated rendered formula in repeat

Case Study 1 - Repeat

37

Page 46: Move Your XPages Applications to the Fast Lane

• Add Application Scope variables to store database names

• Or (better yet) create an ApplicationBean in Java

Case Study 1 – First Step add scoped variable for Config (db names)

38To retrieve:

Page 47: Move Your XPages Applications to the Fast Lane

Improvement – Repeat_Config

39

Xpage Calls Time CPU Time Calls(%)BE

Time(%)CPU

Time(%)

Start 3564 1547 1688

Cache Config 2499 733 1016 143% 211% 166%

Page 48: Move Your XPages Applications to the Fast Lane

• Add App Scope variable to store user roles

• No more @DbLookup in rendered

– Pulls value from memory - much faster!

Case Study 1 – Next add scoped variable for User Information

40

To retrieve:

Page 49: Move Your XPages Applications to the Fast Lane

Improvement – Repeat_User

41

All previous changes are cumulative....

Xpage Calls Time CPU Time Calls(%)BE

Time(%)CPU

Time(%)

Start 3564 1547 1688

Cache Config 2499 733 1016 143% 211% 166%

Cache User 1992 265 469 179% 584% 360%

Page 50: Move Your XPages Applications to the Fast Lane

• Avoid opening NotesDocument object to get values not in the view

– Created a new view with missing columns

– Changed reference to use EL for all but two columns that need to lookup in another DB

Case Study 1 – Next create a new view

42

Page 51: Move Your XPages Applications to the Fast Lane

Improvement – Repeat_BetterView

43

All previous changes are cumulative....

Xpage Calls Time CPU Time Calls(%)BE

Time(%)CPU

Time(%)

Start 3564 1547 1688

Cache Config 2499 733 1016 143% 211% 166%

Cache User 1992 265 469 179% 584% 360%

Better View 1656 283 375 215% 547% 450%

Page 52: Move Your XPages Applications to the Fast Lane

• Avoid doing the @Dblookup to get the sales person based on the region

• Use a Bean to cache Region/Salesperson data

– HashMap: key is region name, value is salesperson

– Application scope (shared by all users)

Lookup the Sales Person from a Bean

44

Page 53: Move Your XPages Applications to the Fast Lane

Improvement – Repeat_CacheRegion

45

All previous changes are cumulative....

Xpage Calls Time CPU Time Calls(%)BE

Time(%)CPU

Time(%)

Start 3564 1547 1688

Cache Config 2499 733 1016 143% 211% 166%

Cache User 1992 265 469 179% 584% 360%

Better View 1656 283 375 215% 547% 450%

Cache Region 1614 93 250 221% 1663% 675%

Page 54: Move Your XPages Applications to the Fast Lane

• Store Sales Total by Customer in HashMap

– viewScope Managed Bean

• Caches sales total, key is customer name

• Also use ViewNavigator to get totals via getNextCategory()

– Fast initialization of HashMap

Next Try: Use Java to Cache Sales Lookup

46

SSJS call to Bean

Page 55: Move Your XPages Applications to the Fast Lane

Improvement – Repeat_ComputeSalesJava

47

All previous changes are cumulative....

Xpage Calls Time CPU Time Calls(%)BE

Time(%)CPU

Time(%)

Start 3564 1547 1688

Cache Config 2499 733 1016 143% 211% 166%

Cache User 1992 265 469 179% 584% 360%

Better View 1656 283 375 215% 547% 450%

Cache Region 1614 93 250 221% 1663% 675%

Compute Sales - Java 816 16 172 437% 9669% 981%

Page 56: Move Your XPages Applications to the Fast Lane

• CustomerBean

– passes Collection of customer objects to Repeat

– The scope could be request, view, or application

• CacheBean

– Long lived information

– Config settings (database path and name)

– User profile (manager, sales rep or user)

– Region information (get Sales person for region)

– Application Scope

Do Everything in Java!

48

Page 57: Move Your XPages Applications to the Fast Lane

Java Classes

49

CustomerBean

CacheBean

Page 58: Move Your XPages Applications to the Fast Lane

Improvement – Repeat_AllJava

50

Xpage Calls Time CPU Time Calls(%)BE

Time(%)CPU

Time(%)

Start 3564 1547 1688

Cache Config 2499 733 1016 143% 211% 166%

Cache User 1992 265 469 179% 584% 360%

Better View 1656 283 375 215% 547% 450%

Cache Region 1614 93 250 221% 1663% 675%

Compute Sales - Java 816 16 172 437% 9669% 981%

All Java (request scope) 401 47 141 889% 3291% 1197%

All Java (view scope) 6 0 109 59400% NA 1549%

Page 59: Move Your XPages Applications to the Fast Lane

Performance Improvement for Case Study 1

51

0

500

1000

1500

2000

2500

3000

3500

4000

Axi

s Ti

tle

Calls Time CPU Time

Page 60: Move Your XPages Applications to the Fast Lane

Case Study 2: Partial Refresh and Execution

• Added a lookup to compute sales by region– Full Update/Exec

– Partial Refresh

– Partial Exec

– Both

52

Xpage Calls Time CPU Time Calls (%)BE

Time (%)CPU

Time(%)

Start 1918 1109 1375Refresh 516 672 781 691% 230% 216%

Exec 1414 610 688 252% 254% 245%

Both 12 31 78 29700% 4990% 2164%

0

500

1000

1500

2000

2500

Start Refresh Exec Both

Calls Time CPU Time

Page 61: Move Your XPages Applications to the Fast Lane

Recap

• Think about performance when designing– JSF Lifecycle

• Avoiding computations in rendered– Cache whenever possible

• Scoped variables• Beans

• Measure performance– Part of your testing processes– Look for ways to improve

53

Page 62: Move Your XPages Applications to the Fast Lane

• TLCC Performance Webinar with Ulrich Krause and myself from October, 2013

– YouTube and Slides

• Paul Withers blog (each link below is different)

– Part 1, Part 2, Part 3

• Tony McGuckin’s Video - XPages Master class

– 4 videos plus sample applications

• IBM article on JSF (non XPages)

54

Homework Time – Further References

Page 63: Move Your XPages Applications to the Fast Lane

Questions????

55

Use the Orange Arrow button to expand the GoToWebinar panel

Then ask your questions in the Questions panel!

Remember, we will answer your questions verbally