Expand my Community achievements bar.

SOLVED

PDF Performance: add/removeInstance v.s. hidden/visible presence

Avatar

Former Community Member

Hi All,

We have a smart pdf form with multiple pages, but it only show 1 page at a time, like a wizard or form guide.

And so far we have 2 approaches:

1) From http://www.adobe.com/devnet/livecycle/articles/lc_designer_controller.pdf , i see that the instanceManagers are stored in an array and it try to add/removeInstance whenever user click on the link.

E.g when initialize:

im[currentPageNum].addInstance();

where im[currentPageNum] is an instanceManager.
When navigate to new page:
im[currentPageNum].removeInstance(0);
im[pageNum].addInstance();
2) We store all the page in the array and use the presence attribute instead.
E.g.
im[0].presence="visible";
im[1].presence="hidden";
...
im[9].presence="hidden";
Is there any difference in form performance between 2 approaches?
Thank you,
Regards,
Anh

1 Accepted Solution

Avatar

Correct answer by
Former Community Member

In the long run ...no there is no overall difference in performance. But there is a difference as to when you

will "pay" for the performance.

In option 1 when the form initializes you are only creating objects that exist on the pages that are being shown. When you change the page the new objects are being created and used. So each time you turn a page you are paying for the creation of the new objects.

In option 2 you are creating all objects for all pages right away. If your form is big enough you may see that option 2 will take longer to start than option 1. Also if any redrawing or relayout occurs in the form option 2 will take longer because there is more to do.

So I woudl suggest option 1 for better performance....this will only be an issue for large forms.

Hope that helps

Paul

View solution in original post

2 Replies

Avatar

Correct answer by
Former Community Member

In the long run ...no there is no overall difference in performance. But there is a difference as to when you

will "pay" for the performance.

In option 1 when the form initializes you are only creating objects that exist on the pages that are being shown. When you change the page the new objects are being created and used. So each time you turn a page you are paying for the creation of the new objects.

In option 2 you are creating all objects for all pages right away. If your form is big enough you may see that option 2 will take longer to start than option 1. Also if any redrawing or relayout occurs in the form option 2 will take longer because there is more to do.

So I woudl suggest option 1 for better performance....this will only be an issue for large forms.

Hope that helps

Paul

Avatar

Former Community Member

Thank you for your prompt reply, Paul.

Best regards,

Anh

The following has evaluated to null or missing: ==> liqladmin("SELECT id, value FROM metrics WHERE id = 'net_accepted_solutions' and user.id = '${acceptedAnswer.author.id}'").data.items [in template "analytics-container" at line 83, column 41] ---- Tip: It's the step after the last dot that caused this error, not those before it. ---- Tip: If the failing expression is known to be legally refer to something that's sometimes null or missing, either specify a default value like myOptionalVar!myDefault, or use <#if myOptionalVar??>when-present<#else>when-missing. (These only cover the last step of the expression; to cover the whole expression, use parenthesis: (myOptionalVar.foo)!myDefault, (myOptionalVar.foo)?? ---- ---- FTL stack trace ("~" means nesting-related): - Failed at: #assign answerAuthorNetSolutions = li... [in template "analytics-container" at line 83, column 5] ----