Jump to content
Macro Express Forums

Variable implementation and performance implications


Recommended Posts

I'm curious about how variables are implemented... or, to be more specific, I'm curious if the way they're implemented has performance implications when you start dealing with macros that have many variables.

 

What are the implications of defining one hundred variables on a single macro? What about one thousand? Ten thousand?

 

For context, this is a purely theoretical question. Dealing with a macro that has a thousand (or ten thousand!) variables is an experience I'd rather avoid.

 

Cheers!

 

Adam

Link to comment
Share on other sites

I'm curious about how variables are implemented... or, to be more specific, I'm curious if the way they're implemented has performance implications when you start dealing with macros that have many variables.

 

What are the implications of defining one hundred variables on a single macro? What about one thousand? Ten thousand?

 

For context, this is a purely theoretical question. Dealing with a macro that has a thousand (or ten thousand!) variables is an experience I'd rather avoid.

 

Cheers!

 

Adam

I can't speak for the developers, but from my understanding, the limits or performance issues one might experience when running a macro containing vast numbers of variables would be affected primarily by the system the macro is being run on (ie., Intel Quad Core 2.6GHz with 8GB RAM, will handle it much more smoothly than a P3 800MHz machine with 256MB RAM).

 

But for an undeniably correct answer, the devs will have to reply.

Link to comment
Share on other sites

I have many macros that use thousands of variables mostly in arrays and having many variables doesn't seem to slow the system down more than the fact that doing things with this many variables takes thousands of small operations which will add up. At a certain point memory limitations will kick in and the system will start thrashing VM but in a modern machine I doubt you will have this problem. However certain variable operations can bring a system to it's knees as I have found out several times now. EG I had a macro that collected a bunch of data and accumulated it into a large text variable as a cache that would later be written to disk. It was molasses in January slow. But I changed it to output one line at a time making thousands of disk writes and that went much faster. I have never received a satisfactory answer from ISS as to exactly what is happening and what to avoid but it seems that when ever we resize large variables the world stops. I plan on testing some things myself when I have time to determine what's happening but for now bear in mind that there are some operations that can be painfully slow. I know, today will be the third time rewriting a macro dealing with a large chunk of data that MEP keeps choking on.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...