Use Form View when configuring session state for InfoPath Forms Services
By peter.stilgoe
You can configure InfoPath Forms Services to use the Session State Service (the default option) or Form View to control how user sessions are managed. When you configure InfoPath Forms Services to use the Session State Service, all browser sessions are maintained on the SQL Server database corresponding with the Shared Services Provider (SSP) associated with the Web application on which the form template is hosted. This scenario uses little network bandwidth, but has a cumulative performance impact on the computer running SQL Server. When you are using Form View, sessions are maintained on the client browser, and all session data is included in each postback to the server, up to 40 kilobytes of session data. This uses more bandwidth than using session state, but does not affect the computer running SQL Server. Once session data reaches 40 KB in size, the session automatically transitions to session-state management.
We recommend the use of Form View in environments that have smaller groups of users, because it reduces the impact on SQL Server. If your InfoPath Forms Services deployment will have many users, particularly if session data is below 40 KB for many high-usage form templates, session state is likely a better choice. If Form View is used, the bandwidth used by browser sessions of 40 KB or fewer can be monitored if there is a concern that network performance might be adversely affected.
InfoPath Performance Tips
By peter.stilgoe
Upgrade to IE7 on the desktop. There are performance benefits to moving up to IE7. In some cases the difference is 5x to 10x.
Make sure the IE cache is big enough so our necessary 250K of content and scripts needed for the browser to render Forms Services forms – doesn’t get pushed out the cache after an initial download. Customers with extraordinarily low thresholds (like ~1MB) will have issues. Disk is cheap, increase that value to something reasonable like 10% of disk.
A good perf trick is to populate dropdowns via an XML file (especially if they are somewhat static) that is made a part of the form XSN. We can cache that on the server and get good load performance optimization. You can always republish the solution when the data changes.
If you have to download data via a data connection for a dropdown list or calculation, try to dynamically build a filtered query (via code) so that you are as efficient as possible with what you are retrieving.
Try to minimize On_Load activities like queries unless absolutely necessary.
Conditional visibility logic has some known performance problems. A hotfix is available http://support.microsoft.com/kb/937206, which is manifested in a modifed 250K initial download when accessing Forms Services the first time. The performance issue is related to the IE Script Engine and occurs at the browser level, not server-side.
Instead of using conditional visibility logic, try implementing multiple views on a form. Splitting complex views into more than 1 view provides noticeable performance improvements.
Rich Text controls are noticeably slower in IE vs. Firefox, because Rich Text editing in Forms Services is an IE-only feature. Limiting the number of Rich Text controls shown in the same view can really help form performance.
Try to prevent unnecessary roundtripping between the form browser and the server. There are several round trip switches available on controls. See the Browser Forms Tab on a given control to expose finer-grained options over the behavior. Note what the warning messages you receive say about the form’s potential round trip behavior when admin deploying the form. It will tell you when multiple server roundtrips will be likely to occur when using your form.
If you have to do roundtrips to the server, try to have them triggered by buttons, so that the users know they initiated the wait themselves. This UI trick can tend to reduce user dissatisfaction with the form performance.
Try not to treat an InfoPath form as a full, rich VB application. It’s not designed to be performant in that use case.
The more declarative logic (heavy use of rules, etc.) and managed code you have in the form, the slower it will be. Try and follow the KISS method if at all possible (Keep it Simple, Stupid).
Consider breaking out the server role of Forms Services to another machine on the MOSS farm. Services such as indexing and query serving, or high file I/O operations can really impact the ability of Forms Services to get a time slice and perform properly.



September 24th, 2009

![Recommend [pstilgoe]](http://s3.amazonaws.com/arkayne-media/img/badge/logo-recommend-badge-medium.png)