As I understand it.... The time it takes for your macro process to run is about the same for any section. Why?
The reason it's an issue is because all the tests I've done with my UB mod indicating a very short installation time are being discounted as irrelevant because my UB mod doesn't actually add containers specifically. It actually adds far more complex stuff that is a lot more WRITE-intensive, but that doesn't apparently matter, for some reason containers alone are supposed to create these timing issues.
Don't feel you need to do these tests on my account. Since I know containers are no different, the UB tests going quickly are more than enough evidence for me that the purported "dramatic" increase in runtime upon multiple uses does not exist.
Qwinn
I was going to convert it (the container add on) to use your macros anyway... I'm slowly going through all my area patches and converting to at least use your variables so I don't have to do any additional reading... While there, I've found various other types of files that would benefit from having a function or macro because I edit the same fields for several files. In fact the conversion is already done, I just need to uninstall and reinstall to test it.... No, I don't... I forgot. My computer suffers from the merged override contents syndrome. That particular area file is one of the bad files that need to be removed... I can just make sure that the fixpack is not installed and give the container add on mod a test run...
Be back with the results in a few....
...goes off to give it a test run......comes back huffing and puffing...Using least amount of time waiting for input (i.e my finger was hovering over the number to press and another finger over the enter button)
When the container addition using Qwinn's macros are first in the subcomponent list:
A64's macro code in an external file -- total of 0.562 while Qwinn's macros in the header -- total of 3.485
A64's macro code in the header -- total of 0.485 while Qwinn's macros in an external file -- total of 3.031
When the container addition using A64's macro code is first in the subcomponent list:
A64's macro code in an external file -- total of 0.672 while Qwinn's macros in the header -- total of 3.047
A64's macro code in the header -- total of 0.563 while Qwinn's macros in an external file -- total of 3.312
Both do the same work i.e. add one container with one item and 5 associated vertex points
There are some notable differences
A64's code inserts the bytes and does the writes inside the tp2 code also the new entries are added to the beginning of the respective sections (this is where I had picked up that habit)
Qwinn's code inserts the bytes within the macro and the writes are in the tp2 code also the new entries are added to the end of the respective sections.
Qwinn's code uses two patch_for_each commands one to match the section(s) being added and the second to examine the other sections to see if they need updating. He uses the patch_for_each commands along with the pre-defined offset variables to have only one single block of update code. A64 uses the numerical offset values and update code for every section. A64's macro does not add the space and has to be called every time space is inserted.
It boils down to this...
If you are doing just one thing and you won't be using the macro later for anything else, go with something simple.
If you are doing multiple things and you will need to use the macro later for more stuff, go with the more versatile but 'longer' running code...
The total time for Qwinn's macros includes using one call to Q_ARE_InitVars, one call to Q_AREAdd_InitVars, one call to Q_AREAdd_Process which recalls Q_ARE_InitVars once for each section being added to. This multiple macro call is what allows it to insert bytes and update offsets for multiple sections in one shot.
The two cannot be properly compared for run time because of the difference in scope, abilities and limitations of each...
Hey, I quoted you pre-edit
EDIT:
Per a conversation with GeN1e via PM, I created an ACTION function that would allow the user to set all their values within the launch command. The function calls up Qwinn's macros and adds as many floor triggers (i.e traps and other proximity type triggers) as the user wants along with their associated vertex points. Due to the nature of the multi-use of the writes I needed to use PATCH_FOR_EACH to resolve the large number of variable names. When PATCH_FOR_EACH was added, the amount of time it took to process increased. I believe that PATCH_FOR_EACH is the culprit in the higher run time found with the use of Qwinn's macros.
So if that is indeed the case, I wonder if ACTION_FOR_EACH causes an increase in run time as well.... But does it really matter? We aren't talking about taking up hours of a players life to install a mod, just a few more seconds maybe a minute tops depending upon number of uses and how big the mod is...
:END EDIT
Edited by Sasha Al'Therin, 12 June 2009 - 02:35 PM.