Your achievements

Level 1

0% to

Level 2

Tip /
Sign in

Sign in to Community

to gain points, level up, and earn exciting badges like the new
Bedrock Mission!

Learn more

View all

Sign in to view all badges

SOLVED

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

Avatar

Level 4

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
Level 10

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
Level 10

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

Level 4

Thank you for your prompt reply, Paul.

Best regards,

Anh