Posts Tagged ‘performance’

10 Dec 2015
6

Notes Database Performance Tip: Disable Unread Marks

A Quick Summary of this Post

Unread Marks are enabled by default when creating a new Notes Database. In most cases, especially for applications used by multiple users, unread marks are not required and has a significant performance cost when the Notes database grows in size.

To disable Unread Marks:

  1. Right-click on your Notes database and select “Application -> Properties
  2. Click on the last tab
  3. Check the option “Don’t Maintain Unread Marks
  4. Compact the Notes database

A Detailed Overview

Through my years as a Notes developer, I’ve seem many cases where unread marks are enabled for Notes applications. One of the main reasons for this is that unread marks are by default enabled when creating a new Notes database. Many developers ignore this setting and continue developing an application for their client, where unread marks are most of the time not required.

Unfortunately, this comes at quite a cost to performance when the application grows in data, especially if the affected Notes database contains many Views.

In all my time as a Notes developer, I’ve never once required unread marks in the applications I developed. This became even more so the case when I moved to XPages development. I do understand that there are some cases where one would use it, but my recommendation is simple: If you don’t need it, disable it!

There are 3 settings to manage Unread Marks for a Notes database:

  1. Don’t maintain unread marks (Database Property – Last Tab)
  2. Do not mark modified documents as unread (Database Property – Tab 4)
  3.  Manage Unread Marks on a Notes View level (View Property – Tab 5)

It’s important to note that if you want to leave Unread Marks enabled for your Notes database and instead specify in your Notes View that there should be no unread marks, the View is still affected. See below abstract from the Domino Designer Help:

Note: Designing views that don’t display unread marks doesn’t improve database performance because they are still maintained but not displayed.

This means that to improve database performance, you have to implement one of the first 2 options mentioned above, at the very least option 2.

Closing

I can’t stress enough the impact unread marks can have on a Notes database. If you don’t need it…disable it. Depending on the size of your Notes database, the results are almost immediate.

Cheers for now
John
7 Dec 2015
1

John Jardin’s 2nd Session at IBMConnect 2016: Optimus XPages

IBM-Connect-2016

So, to my utter surprise, my second Abstract for IBM Connect 2016 was approved. It’s titled “Optimus XPages: An Explosion of Techniques and Best Practices“. For a reference to my first Abstract, click here. Just so everyone knows, IBM Connect takes place at “The Hilton” in Orlando, Florida. My session “Optimus XPages” is scheduled for Monday the 1st February 2016 at 3:30pm.

I am extremely excited to be presenting this session. Over the past year I have implemented a number of solutions running on XPages, and I got to experience first hand the improvement in performance and overall user experience when comparing these solutions to ones I developed in the past. I feel I have come up with some serious practices that anyone can easily apply to make their applications work and feel fast and responsive, whether running on a local network or in the cloud.

Below is a rundown of my session:

TITLE:

AD-1074 – Optimus XPages: An Explosion of Techniques and Best Practices

SESSION SUMMARY:

Starting a new XPages project but not sure it’s going to be done right the first time? Do you have an existing application that doesn’t seem to have that “X” Factor? In this session John will demonstrate how XPages developers can apply proven techniques and best practices to take their applications to a game changing level.

WHAT WILL ATTENDEES LEARN:

  1. Rapidly develop responsive applications
  2. Improve user experience and response times with background and multi threaded operations
  3. Keep your XPages lightweight with code injection
  4. Create scheduled tasks the XPages way
  5. and much more.

I hope to see you all there :)

Cheers for now :)
John
15 Sep 2015
0

Appcelerator Video Tip: Reduce EventListeners and increase performance

In this video I show you how to eliminate unnecessary Event Listeners in your Appcelerator Mobile App by making use of the Bubble Parent property. This is a great way to increase performance and responsiveness in your mobile app, especially when it requires some advanced processes.

The video below demonstrates the the Bubble Parent technique when using Text Fields inside Table View Rows for an iOS app. I’m sure you’ll immediately understand how you can apply it elsewhere in your mobile application, whether developing for iOS or Android.

As always just a thanks to David Leedy for hosting this video on NotesIn9. Always appreciated :)

Enjoy :)
John
21 Sep 2012
3

LotusScript Tip: Set Readers and Authors Fields in new Documents

Hi Everyone. I’ve been using this forever but I noticed recently that it’s not really common knowledge.

Let’s say you have a Form Design and in it you have a Readers and Authors field. Now let’s also say that you create NotesDocuments for this Form Design in the back-end. The question is: How do you populate a field in LotusScript and turn that field into a READERS or AUTHORS if required.

Many use a famous trick called “ComputeWithForm” which is a method that belongs to the NotesDocument Object. In simple terms, a ComputeWithForm will evaluate the entire NotesDocument against the Form Design it’s associated with….i.e. If you have a Form with 50 Computed Fields that contain various @Formulas, a ComputeWithForm will evaluate each of those Formulas for your NotesDocument Object.

e.g.

‘ VARIABLES
Dim ss as New NotesSession
Dim db as NotesDatabase
Dim doc as NotesDocument
 
‘ CODE
Set db = ss.CurrentDatabase
Set doc = db.CreateDocument
 
Call doc.ReplaceItemValue( “Form”, “FormAliasName” )
Call doc.ComputeWithForm( False )
Call doc.Save( True, True )

 

While this can do the job and save you a lot of coding, a ComputeWithForm can make your code terribly slow depending on how many fields and Computed Values are in the Form and how many documents you plan on computing. I’ve seen a ComputeWithForm take 2 seconds to evaluate 1 NotesDocument. In that time your code could’ve achieved the same goal and a lot more if you wrote your code to not use it. Anyways, moving on.

 

If you didn’t use ComputeWithForm, you would land up having an issue with Readers and Author Fields in your NotesDocument:

e.g.

‘ VARIABLES
Dim ss as New NotesSession
Dim db as NotesDatabase
Dim doc as NotesDocument
 
‘ CODE
Set db = ss.CurrentDatabase
Set doc = db.CreateDocument
 
Call doc.ReplaceItemValue( “Form”, “FormAliasName” )
Call doc.ReplaceItemValue( “CurrentReaders”, “John Jardin/Ukuvuma” )
Call doc.ReplaceItemValue( “CurrentAuthors”, “John Jardin/Ukuvuma” )
Call doc.Save( True, True )

 

If you had to open the DocumentProperties for this Saved NotesDocument and in the Field Properties Tab click on CurrentReaders, you will see it’s a Normal Text Field. This can cause massive issues from an Access point of view.

To solve this problem, we turn to our ever faithful friend…….NotesItem. Using the NotesItem Object, you can set the Field Type in your code. See below Examples 1 and 2:

e.g.

‘ VARIABLES
Dim ss as New NotesSession
Dim db as NotesDatabase
Dim doc as NotesDocument
Dim item as NotesItem
 
‘ CODE
Set db = ss.CurrentDatabase
Set doc = db.CreateDocument
 
Call doc.ReplaceItemValue( “Form”, “FormAliasName” )
 
Example 1
 
Call doc.ReplaceItemValue( “CurrentReaders”, “John Jardin/Ukuvuma” )
Call doc.ReplaceItemValue( “CurrentAuthors”, “John Jardin/Ukuvuma” )
Call doc.ReplaceItemValue( “CreatedBy”, “John Jardin/Ukuvuma” )
 
Set item = doc.GetFirstItem(“CurrentReaders”)
item.Isreaders = True
 
Set item = doc.GetFirstItem(“CurrentAuthors”)
item.Isauthors = True
 
Set item = doc.GetFirstItem(“CreatedBy”)
item.Isnames = True
 
Example 2 – (Preferred Option)
 
Set item = New NotesItem( doc, “CurrentReaders”, “John Jardin/Ukuvuma”, READERS )
Set item = New NotesItem( doc, “CurrentAuthors”, “John Jardin/Ukuvuma”, AUTHORS )
Set item = New NotesItem( doc, “CreatedBy”, “John Jardin/Ukuvuma”, NAMES )
 

Also, so you know, SSJS for XPages also has a NotesItem Object that you can use similar to what we’ve done here. I’m not sure about Example 2 though.

Until next time, happy coding

John.

29 Aug 2012
9

Notes Database Performance Tip: Optimize Document Table Map

Hi Everyone. In the past few days I’ve been asked to audit a few Notes Applications. Apart from the usual disabling of unread marks and removing views no longer used to increase performance, there is a very important setting on a Notes Database and can drastically reduce the indexing time of Notes Views.

It’s called “Optimize Document Table Map“.

Firstly, a quick scenario:

Let’s say you have a Notes Application that contains about 5 different Forms. For each form you have about 3 – 5 Notes Views. Also for each Form you have about 5000-10000 documents.

When it comes to indexing Views, if the property “Optimize Document Table Map” is not selected in the Notes Database Properties, the following happens:

When indexing a certain View,  Notes will search through all documents created from all 5 Forms in the Database to produce the result in the View. If you only have a few hundred documents in the database, then this is not an issue. However, 50 000 documents later this could lead to poor performance of your Views.

 

So, let’s say that you have “Optimize Document Table Map” selected in the Notes Database Properties, the following will happen:

When indexing a certain View, Notes will only search through all records in the Database that were created using the Form that’s specified in the View Selection Formula. This means that if you have 5 Forms in the Database, and 5 000 records for each Form, Notes will only search through 5 000 records for a specific Form to index the Notes View. Can you imagine the Response Time :)

 

So, where to enable this setting? If you right-click on your Notes Database and go to the “Database Properties”, click on the last tab. You will see towards the Top that you can check the option “Optimize Document Table Map

 

2 Important Notes when enabling this Setting:

1. I’ve had varied results with enabling this property and just expecting it to work. I highly recommend compacting the database after enabling this Setting just to be sure.

2. In order for this setting to Work, it’s very important that your View Selection Formula for your Notes View specifies the Form Name.

i.e. If your View Selection Formula only says Select FirstName = “John”, then you won’t see a performance boost on the view. However, if you say Select Form = “Person” & FirstName = “John”, this will work because you are referencing the Form Name inside the View, which if you think about it, makes sense.

 

I hope this helps everyone. Happy Coding :)

John

12