Cory Posted February 1, 2010 Report Share Posted February 1, 2010 In the ME3 days I used to search for things in big accumulator variables and when I switched to MEP I started using the arrays instead because I found that resizing string variables caused some huge slowdowns. The other day I was revisiting a macro I wrote way back when I changing it to use arrays instead because it was really slow. While trying to ID the problem spots I ran a couple of simple speed tests and I thought some of you might find the results interesting. The macro runs thru approx. 25k folders and validates them all with several tests to ensure they're in compliance with the naming conventions as well as look for potential problems like invalid SSNs. Here were my simplified tests and the results. Simply run thru all the folders using "Repeat with Folder" on a local drive with no other commands. Of course this changes the one variable each time. 1.0S total, 42µs EA. Run thru all the folders using "Repeat with Folder" on a local drive and load an array. 1.0S total, 41µs EA. Run through array of 25K and perform an "If Equals" test. 0.9S total, 34µs EA. Run through array of 25K and perform an "If contains" test with a single character. 0.9S total, 35µs EA. Run through 25k folders using "Repeat with Folder" and accumulate into a single variable. 20.7S, 830µs each. Repeat 25k times doing an "If Contains" on an accumulator variable of 25k folder names. 14.4S, 577µs. Essentially my old way used a combination of 5 and 6. I knew it was faster to use arrays but I was surprised to see how much. I was also surprised ot see that an "If Contain" is about the same speed as an If Equals. Quote Link to comment Share on other sites More sharing options...
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.