When you need to handle a lot of active contents and you can identify the used active content by a key, you still have two options to get to the active content:
- You can create a key map for the active contents, using the identifier as key
- You can create an active content group using the identifier as a custom property value.
Using a key map means your active contents cannot have parameters or a return value, which are allowed with an active content group.
The key map hides the actual active contents from the logic tree, but you can achieve the same when you put the active content group in an active content.
Some time ago a colleague of mine was desperate because of gigantic start-up times of the publications he was working on. The publications contained a number of key maps with each hundreds of active contents. Opening the publication took over 10 minutes, and each display also took several minutes. Since that time PBS has done some work to improve processing of keyed active content, and that already reduced the display time quite a bit. This was especially the case in the situation that the supplied key did not match any of the keys in the map: that took each time 2 seconds, but the modifications removed this delay almost completely.
With version 4.4.9 I did some retesting to see if there was still a difference in the processing of the two methods. And yes, there is still a difference. In my test I have 16 active contents in a key map, and created an active content group with the same active contents. I then created a loop to address the active contents using a numeric key. I used the system variable 'Elapsed CPU ticks' to measure the time.
It appears that in this case using an active content group is about 10 times faster than the keyed active content (about 750 ticks compared to about 8000 ticks).
The publications my colleague was working on have been modified to use active content groups, and start-up and display times have become quite acceptable (seconds instead of minutes).
So, apart from the functional benefits, using active content groups instead of keyed active content can improve life for a designer.
The run-time performances do not differ that much, so the advantage is mainly in the design phase.
------------------------------
Adrie vlutters
Consultant
Document Dialog B.V.
Bunnik
------------------------------