Linda Posted November 1, 2004 Report Share Posted November 1, 2004 Hi! I'm wondering if anyone has any thoughts on optimization of ME scripts. As I break more and more short but repetive peices out of the latest batch of legacy macros I am revising, the code is becoming clearer, but it is also taking noticably longer to run. Since these scripts are used interactively to help people with common workflows, ths is a problem. There seems to be a great deal of overhead in calling a new macro, dragging up the cost of what in other languages is good coding practice. Is there a way I can reduce the overhead of macro-to-macro calls, so that I don't have to have gobs of repetitive code to improve preformance? Thanks! Quote Link to comment Share on other sites More sharing options...
Linda Posted November 1, 2004 Author Report Share Posted November 1, 2004 Hmm... Further testing shows that the slow-downs aren't consistent. I guess It's not ALWAYS slower, but there is definitely greater variation in speed with the macros broken out. Maybe it's not overhead from macro-calling after all? Quote Link to comment Share on other sites More sharing options...
floyd Posted November 1, 2004 Report Share Posted November 1, 2004 Linda, When you refer to "breaking out" code snippets, are you meaning out to playable macros or out to other macros in the same library? Quote Link to comment Share on other sites More sharing options...
Linda Posted November 1, 2004 Author Report Share Posted November 1, 2004 I mean subroutine macros- macros called by the first macro using "Macro Run", not independantly invoked by the user. And they exist in the same MEX file-- is that what you mean by "in the same library"? Quote Link to comment Share on other sites More sharing options...
floyd Posted November 1, 2004 Report Share Posted November 1, 2004 Yes, that is what I meant. I do not notice any slow downs using the Macro Run command. BUT ... that might be because everything we do here involves the Macro Run command. Have you checked the cache setting (Options | Preferences | Caching)? We set ours to 4,096 ... which is probably overkill. Also, have you attempted to adjust the Macro Priority setting in the Registry? This is accessed via the TweakMe3.mxe utility. Here's a good explanation of it from the Macro Express Explained book: This integer value specifies how much time that Macro Express is allowed to use your computer's CPU/processor. The allowable range is 0 through 2,147,483,647. The default value is 1,000. Zero turns this feature off, which gives full priority to Macro Express. You will need to enter a "-1" in the dialog to turn it off, which is then converted and stored as a zero. A "1" gives the lowest priority to Macro Express. The higher the number the more priority is given to running your macros and conversely for the lower the number. Experiment with caution! Quote Link to comment Share on other sites More sharing options...
Linda Posted November 1, 2004 Author Report Share Posted November 1, 2004 Thanks-- I'll try setting the cache up. If that doesn't solve the issue, I'll push for the tewakme fix (although I hope that's not neccesary, since requesting the download, install, and configuring of even a tiny application on two dozen users' machines is going to be a beurocratic nightmare ) I think it is a caching issue, simply beause it's slowest the first time I run a macro, or if I come back to a macro after running several others. Cheers. Quote Link to comment Share on other sites More sharing options...
paul Posted November 1, 2004 Report Share Posted November 1, 2004 I'll push for the tewakme fix (although I hope that's not neccesary, since requesting the download, install, and configuring of even a tiny application on two dozen users' machines is going to be a beurocratic nightmare) You can equally well create a very small .reg file containing the registry mod required, then either distribute it or perhaps even update your users' registries remotely. If you need help in constructing the necessary .reg file, let me know. Quote Link to comment Share on other sites More sharing options...
kevin Posted November 2, 2004 Report Share Posted November 2, 2004 TweakMe3 is a playable macro that makes changes to the area of the registry where the Macro Express preferences are saved. Macro Express includes several commands that allow you to write to the registry such as "Write Registry Decimal", "Write Registry Integer" and "Write Registry String". You could write a macro, or modify an existing one, to set the Macro Priority. Some organizations with networks have a shared macro library. That would be an easy way to distribute a macro that adjusts the Macro Priority. To see which registry key and value contain the setting for Macro Priority, I recommend that you download TweakMe3 from www.macros.com/downmore.htm and import it into the macro library on your test or adminstrative computer. Then you can examine it to see how it works. You could even copy certain portions and paste them into a macro that you distribute to the computers on your network. Quote Link to comment Share on other sites More sharing options...
Linda Posted November 2, 2004 Author Report Share Posted November 2, 2004 Cool, thanks for the info. Linda Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.