Page 1 of 1 1
Topic Options
#78461 - 2001-10-06 08:23 AM @Macros
Howard Bullock Offline
KiX Supporter
*****

Registered: 2000-09-15
Posts: 5809
Loc: Harrisburg, PA USA
Are all the macro values populated only once at the start of Kix32 or is the data retrieved when a macro is used? If it is the latter, is the value cached? If it is the first wouldn't it be better to only populate the values when requested?
_________________________
Home page: http://www.kixhelp.com/hb/

Top
#78462 - 2001-10-06 10:39 AM Re: @Macros
Jochen Administrator Offline
KiX Supporter
*****

Registered: 2000-03-17
Posts: 6380
Loc: Stuttgart, Germany
Howard,

don't knowing it exactly, but had some timing probes on it I would say most KiX macros are populated dynamically on-demand , values aren't cached (Well, it's quite clear that @error and @serror are cached, in opposition to @time )

We had a topic about that here with @ldomain (obviously not cached)


hth

Jochen

[ 06 October 2001: Message edited by: jpols ]

_________________________



Top
#78463 - 2001-10-06 05:57 PM Re: @Macros
Howard Bullock Offline
KiX Supporter
*****

Registered: 2000-09-15
Posts: 5809
Loc: Harrisburg, PA USA
Thanks for the feedback. The thread you pointed me to was quite interesting. It appears that I will continue touse $x=@Macro at the top of my script for all Macros that will be used. At least until I have more info or have time to test each one.
_________________________
Home page: http://www.kixhelp.com/hb/

Top
#78464 - 2001-10-08 11:21 AM Re: @Macros
Ruud van Velsen Moderator Offline
Developer
*****

Registered: 1999-05-06
Posts: 391
Loc: Amsterdam, The Netherlands
Hi Jochen,

the correct answer is: 'it depends'. Macros of which the value requires network access (such as @FULLNAME) are populated only if and when they are used. Other macros, such as @LDOMAIN do not require network access, and are populated when KiXtart starts.

Note that most values are cached, and do not change during a single KiXtart 'run'.

Kind regards,

Ruud

Top
#78465 - 2001-10-09 12:39 AM Re: @Macros
Jochen Administrator Offline
KiX Supporter
*****

Registered: 2000-03-17
Posts: 6380
Loc: Stuttgart, Germany
Ruud,

thanks for the insight !

So @LDOMAIN is populated at scriptstart ...
Just wonder why the timing is then :

quote:

35000 Iterations of $x = @ldomain : 00:00:05:007
35000 Iterations of $x = $domain : 00:00:00:791 (starts with $domain = @ldomain)

Is it a speed Issue addressing cached macros ?


Jochen

[ 08 October 2001: Message edited by: jpols ]

_________________________



Top
#78466 - 2001-10-08 03:07 PM Re: @Macros
Ruud van Velsen Moderator Offline
Developer
*****

Registered: 1999-05-06
Posts: 391
Loc: Amsterdam, The Netherlands
The speed difference is caused by the internals of the parser: copying the contents of a variable (the 2nd method) is simply faster than resolving a macro and copying the result to a variable.

Kind regards,

Ruud

Top
#78467 - 2003-11-18 09:18 AM Re: @Macros
Lonkero Administrator Offline
KiX Master Guru
*****

Registered: 2001-06-05
Posts: 22346
Loc: OK
the test is unfair though.
you seem to give value only to iterations, not also to the initial set.

or if you do, can't believe my eyes.
on all my tests macros do work faster than vars.
_________________________
!

download KiXnet

Top
#78468 - 2003-11-18 09:59 AM Re: @Macros
Jochen Administrator Offline
KiX Supporter
*****

Registered: 2000-03-17
Posts: 6380
Loc: Stuttgart, Germany
<Can't remember something unfair. Can't also see the olde thread
_________________________



Top
#78469 - 2003-11-18 12:43 PM Re: @Macros
MCA Offline
KiX Supporter
*****

Registered: 2000-04-28
Posts: 5152
Loc: Netherlands, EU
Dear,

Information about the specified link is
- f=2;t=002030 20010731 17:41 20011012 03:56 12 bleonard Script Efficiencies
New link is: sorry with above information we don't get those information.

Based on some very unique words in the post itself we found it back
57625
greetings.
_________________________
email scripting@wanadoo.nl homepage scripting@wanadoo.nl | Links | Summary of Site Site KiXforms FAQ kixtart.org library collection mirror MCA | FAQ & UDF help file UDF kixtart.org library collection mirror MCA | mirror USA | mirror europe UDF scriptlogic library collection UDFs | mirror MCA

Top
Page 1 of 1 1


Moderator:  ShaneEP, Arend_, Jochen, Radimus, Glenn Barnas, Allen, Ruud van Velsen, Mart 
Hop to:
Shout Box

Who's Online
1 registered (mole) and 405 anonymous users online.
Newest Members
Timothy, Jojo67, MaikSimon, kvn317, kixtarts2025
17874 Registered Users

Generated in 0.065 seconds in which 0.03 seconds were spent on a total of 13 queries. Zlib compression enabled.