Performance Tips - InfoPath Dev
in

InfoPath Dev

Use our Google Custom Search for best site search results.

Performance Tips

Last post 11-29-2005 12:26 PM by vt_asparagus. 2 replies.
Page 1 of 1 (3 items)
Sort Posts: Previous Next
  • 11-26-2005 12:55 PM

    Performance Tips

    I had a function of my form that was performing very poorly. We had started talking about performance in some other threads and I posted the following GREAT article -http://msdn.microsoft.com/office/understanding/infopath/default.aspx?pull=/library/en-us/odc_ip2003_ta/html/officeinfopathtroubleshootperformancebestpracticeguidelines.asp

    Anyways, I needed to get this form to perform faster. Well this is what I found:

    - Be a little more careful with the type of XPath queries you are running. For example if you are using the LAST statement it seemed that I could shave a second off by directly referencing the row via index by using selectNodes()(). My timing is not scientific :-)

    - I then stopped using XDocument.View.ExecuteAction("xCollection::insert", "Item_272") to create rows programmatically and instead used appendChild. With appendChild, I have to build an XML string and the row will subsequently be added. I was little bummed out about doing that because from a maintainability standpoint I loose a little bit because if the schema were to change, I have to make sure that I go into the code and modify this XML string that is being built. If I had continued to use ExecuteAction, the row is built by InfoPath using the default template of the form.

    - Finally, I was seeing some improvement but it was not all that I wanted. According to the article I reference above, one of the big performance killers is conditional formatting. So what I did was hide all of the sections while performing this logic and then make it visible again when the logic was complete. I so basically took conditional formatting out of the equation and have it only execute once at the very end. This is was when the time it took to execute the function dropped from 12 seconds to 3 seconds.
    Jason
    http://www.k2distillery.com/
  • 11-29-2005 09:25 AM In reply to

    Thanks for sharing this. As for the appendChild issue you are having, you can avoid schema change problems by loading the SampleData.xml file, selecting and cloning the node you wish to insert, fill in any data in the clone, and then append it. This has the advantage of keeping your nodes automatically in sync with any schema changes.

    Greg Collins [InfoPath MVP]
    InfoPath Dev
  • 11-29-2005 12:26 PM In reply to

    Great idea...may go back and re-implement...
    Jason
    http://www.k2distillery.com/
Page 1 of 1 (3 items)
Copyright © 2003-2019 Qdabra Software. All rights reserved.
View our Terms of Use.