博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
10 WAYS DEVELOPERS CAN IMPROVE PERFORMANCE OF THEIR APPLICATIONS
阅读量:5989 次
发布时间:2019-06-20

本文共 6697 字,大约阅读时间需要 22 分钟。

Performance-tuning Lotus Notes applications is more an art than a science,

and there are probably hundreds of causes for slowness in a database. However,
when you're looking at an application that's not performing well there are a
handful of common places to look first. Here are 10 things that seem to come up
quite often.

  1. NotesView.AutoUpdate. Opening a NotesView and
    stepping through the documents to find or gather information is an incredibly
    common task. One of the best things you can do to improve the speed of walking
    the view, especially if you are modifying or deleting documents, is to set the
    NotesView.AutoUpdate property to False after you open the view and before you
    start getting documents. For example:
    Set view = db.GetView("MySpecialView")view.AutoUpdate = FalseSet doc = view.GetFirstDocument
  2. Use NotesViewEntry for view lookups. Using NotesViewEntry and NotesViewEntryCollection can be significantly faster than
    using NotesDocuments to walk through views or do
    lookups. This is because you are accessing the view index directly (already
    built) instead of having to access each document individually. If you're looking
    for specific information about each document (like field data), you will only
    see the real speed improvements if you use NotesViewEntry.ColumnValues instead of getting the Document object and looking up the field from there.
  3. Cache your NotesView references in code. While
    we're on the subject of NotesViews, another thing
    you should do is cache any NotesView objects that
    you need to use more than once, rather than opening the same view multiple
    times. Opening a database and/or a view takes a very long [relative] time, so
    you only want to do it once per agent/script library/form. Pass the NotesView by reference to functions, or use global
    variables if you must.
  4. Watch out for excessive string concatenations or array building. String
    concatenations only get to be a burden if you're doing thousands and thousands
    of concatenations. If you ARE doing that many, the process slows significantly.
    I posted some performance comparisons a few years ago on
    If you're building arrays, fixed size arrays are fastest, dynamic
    arrays are slightly slower (use ReDim as little as
    possible), and ArrayAppend can be extremely slow if
    you use it in a loop. You should also consider using lists instead of arrays in
    many circumstances.
  5. Only use Readers fields if you really have to.
    Readers fields are a very convenient way to lock
    down access to documents in a database. However, they can cause a database to
    respond very slowly when you open a view (Notes client or Web). This is because
    the view has to check whether you have access to a document before it can
    display it in the view, which is much less efficient than just reading through
    the view index. Here's an it's pretty old but describes the
    problem (and some possible solutions).
  6. Check your view indexes. You can easily check the size of all the view
    indexes in a database by issuing a "show database
    [dbname]"
    command at the server console, or if you don't have access to
    the console, the server's log.nsf file should have that information in the
    database usage documents. In general, the larger the view index, the slower the
    view will be to open, re-index, and use programmatically. Index size and speed
    is a reflection of how many columns in the view are indexed, how efficient the
    view selection formula is, how complex the column formulas are (especially for
    indexed columns, although they all play a part), and how many columns there are.
    Interestingly, recently found that using @IsResponseDoc instead of @AllDescendents in a view formula made the index over 150
    times bigger!
    @Now and @Today are big performance drains when used in view
    selection and column formulas too, but you probably knew that already.
  7. Excessive @DbLookups on forms. I still see this
    problem all the time: forms that use the same @DbLookup in multiple places, or forms that have dozens of
    @DbLookups (often with the NoCache flag set). Poor use of @DbLookups can cause forms to take forever to open. You
    should reuse lookup results whenever possible, cache the lookups when it makes
    sense, and consolidate lookups that are using the same view by creating a column
    with all the lookup values as a delimited string. Here are some articles and
    information to get you started:
  8. Excessive Form/Page refreshes. There is a Notes
    Form property for "Automatically refresh fields."
    You almost NEVER want this to be set. This will recalculate all the fields on
    the form whenever a field value changes, which normally happens quite a bit.
    I've seen forms with a lot of field calculations and lookups that were almost
    unusable because the form keeps refreshing going from field to field. Refreshes
    can also be triggered by code in field events or the field property for "Refresh fields on keyword change" that can be set for
    some field types. Sometimes refreshing the form fields is good, but use it only
    when you have to. Also keep in mind that if you are using a NotesUIDocument object, the AutoReload property defaults to "True." You can set it to "False" if you don't need it.
    On the Web, try to do
    validation and calculations using Javascript when you can. XPages also have some
    nice "partial refresh" options.
  9. Tune up your ODBC queries. Sometimes it's not your database that's slow,
    it's the interaction with other systems. If you're doing ODBC queries against
    external data sources (using LS:DO, LEI, ADO, or JDBC), check how long it takes
    just to do the SQL lookup in the first place. If the SQL query is overly broad
    or complex, you might be able to refine it or work with your DBA to create a
    special lookup table. Also, check the fetch batch size and result caching
    options of your ODBC connections to make sure you're fetching more than one row
    at a time when stepping through a result set.
  10. Smaller is better. Simplify your databases. Prefer smaller forms — fewer
    fields, fewer and less complex tables, fewer subforms, fewer hide-when formulas
    — to larger ones. Prefer two or three small views to one large one. Remove views
    you don't use. Make sure your lookup views have the smallest number of
    computations, columns, and indexes as possible. Don't maintain unread marks or a
    full-text index on a database if you don't need them. Archive old documents to
    another database. If you have a lot of frequently deleted documents due to daily
    data refreshes or similar processes, consider purging the deletion stubs more
    often than the default (search the Lotus technotes or forums for "purge
    interval" to find out how).

For ideas on other ways you can performance-tune your Notes applications,

here are a few places to start looking:

转载地址:http://ufnlx.baihongyu.com/

你可能感兴趣的文章
python 键值对的树实现
查看>>
nginx
查看>>
python网络编程socket之多线程
查看>>
分工表
查看>>
【软工学习】优化管理
查看>>
MySQL创建用户的三种方法 (并授权)转
查看>>
如何起一个本地服务
查看>>
declaration may not appear after executable statement in block
查看>>
【CT】Universal Turing Machine
查看>>
数据之魅(1)单一变量:形状和分布
查看>>
Nginx调优
查看>>
神,赐我一颗平静的心!
查看>>
HDU2045(递推题)
查看>>
企业级 SpringBoot 教程 (二十五)sprinboot整合elk,搭建实时日志平台
查看>>
(一)springmvc+mybatis+dubbo+zookeeper分布式架构 整合 - 平台导语简介
查看>>
Python 之文件上传
查看>>
go 语言基础
查看>>
SpringMVC配置session过期拦截器,返回登录页面
查看>>
【原创】基于部署映像服务和管理(DISM)修改映象解决WIN7 USB3.0安装时报错
查看>>
sqlserver获取系统时间
查看>>