Macro design decisions

Discuss macro implementations, ask for macro help (to share your creations, see User Creations, probably either Campaign Frameworks or Drop-in Resources).

Moderators: dorpond, trevor, Azhrei, giliath, jay, Mr.Ice

Post Reply
neofax
Great Wyrm
Posts: 1694
Joined: Tue May 26, 2009 8:51 pm
Location: Philadelphia, PA
Contact:

Macro design decisions

Post by neofax »

As I am going thru reworking Wrathgons Spell Manager, I notice that it is pushing a chunk of data from macro to macro then writing it to a property before the pass off. As it is doing this, the data chunk is growing in size. So, is it better to pass the data chunk between macros or write to a property then re-pull the property into a variable when needed?
Image
Time-Zone information UTC -5

User avatar
wolph42
Deity
Posts: 9853
Joined: Fri Mar 20, 2009 5:40 am
Location: Netherlands
Contact:

Re: Macro design decisions

Post by wolph42 »

in the wiki you can find a bunch of benchmarks I ran you might be able to draw conclusions from that. But the best is to test yourself using CIF's timer drop-in.
In short if you need to push the data between 2 or 3 macros, keep m there if you need to push them over a 100 calls its better to store them in a property... where's the 'border' no clue, completely depending on the size and type of the data and whether you're pushing it to a lib or a standard token (the latter is slower).

edit: 2 tips:
if speed is of the essence:
- keep the same scope (setting in the oncampaignload UDF creation)
- and or use strproplists and varsfrom/tostrprops functions (very fast!!) if you have to push a lot of arguments.

User avatar
JonathanTheBlack
Dragon
Posts: 544
Joined: Mon Jun 28, 2010 12:12 pm
Location: I'm the worm...

Re: Macro design decisions

Post by JonathanTheBlack »

When I was writing my framework, I just made EVERYTHING in the same scope. All the UDF's were set to use the same scope period. All data was shared and it made it SOOOOOOOO much easier to write the macros since I didn't have to worry about packaging data up, unpacking it in the UDF and then repacking the result to send back to the original macro. The only things you have to be concerned about are the built in count variable for counting loops. YOU CANNOT USE IT!! And that you can't use the same variables over and over for different purposes.

Post Reply

Return to “Macros”