IMPORTANT ANNOUNCEMENT

These forums were permanently set to read-only mode on July 20, 2022. From that day onwards, no new posting or comment is allowed on the site, but the historical content remains intact and searchable.

A new location for posting questions about PlanetPress Suite is now available:

OL Learn - PlanetPress Classic (opens in new tab)

Topic Options
#30212 - 07/16/09 06:34 PM Presstalk coding best practice? (Object vs. Global Function)
-nth- Offline
OL Expert

Registered: 04/01/03
Posts: 236
Loc: Lincoln, NE
I'm working with xml where a lot of presstalk looping code needs to occur to find and display data. Is there any efficiency to be gained by moving presstalk code into global functions instead of having it repeated in presstalk objects?

I understand global functions are more efficient from a change perspective (change one function instead of x # of objects) but do they improve document execution speed or design interface responsiveness?

I'd be looking at consolidating code from about 100 presstalk objects into 10-15 global functions.

I just want to know if it's going to help me before I do it!

Thanks,
-nth-

Top
#30213 - 07/17/09 09:02 AM Re: Presstalk coding best practice? (Object vs. Global Function)
Anonymous
Unregistered


Hi,

As far as the procedure (i.e. algorithm) is the same, I don't see how there could be any noticeable difference in efficiency.


Ben

Top
#30214 - 07/17/09 10:24 AM Re: Presstalk coding best practice? (Object vs. Global Function)
Anonymous
Unregistered


Hi -nth-,

Just out of curiosity, how large is your XML data file? When dealing with XML files, the larger the file, the slower it gets on the design interface, regardless of any presstalk. You can even start experiencing slight slow downs starting at 2Mb XML file. If dealing with files past 10Mb in size, the performance will dramatically be affected, even to the point where the computer stops responding and crashes.

Before starting to code many functions, try to see if dealing with small samples of data helps. In fact, no matter what data type is used in the form, we always recommend to design with small files containing a few records, when possible of course.

Hope this helps. Regards,

Olivier

Top
#30215 - 07/17/09 10:35 AM Re: Presstalk coding best practice? (Object vs. Global Function)
-nth- Offline
OL Expert

Registered: 04/01/03
Posts: 236
Loc: Lincoln, NE
The files are all under 300Kb.

I think the issue is though, that I'm having to do a considerable amount of looping in most of my data objects because of the XML model (complex and very attribute based) and because of limited xpath support in Design (no wildcards in predicates or attributes, etc.).

It got the point where the Design interface would take 5-10 seconds to respond to a mouse click on a page object.

Moving the code to global functions seems to be helping some.

-nth-

Top