Adam Posted February 26, 2009 Report Share Posted February 26, 2009 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 Quote Link to comment Share on other sites More sharing options...
stevecasper Posted February 27, 2009 Report Share Posted February 27, 2009 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. Quote Link to comment Share on other sites More sharing options...
Cory Posted February 27, 2009 Report Share Posted February 27, 2009 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. 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.