Optimization question

rede96

Registered User.
Local time
Today, 23:53
Joined
Apr 2, 2004
Messages
134
I have some code that executes on the 'On Timer' event of a form. I have some variables that I currently store in public arrays, about 12. Eventually there may be up to 15 or so forms open that all will trigger some code using the ‘On Timer’ event on each form. Once open the will run constantly.

Is it better/quicker to store values that I need to keep between timer events in memory, via public variables or should I store the values in hidden text boxes on the form and recall them when needed? (Or does it make any difference?)
 
Unless you are doing really intensive stuff you won't see any difference. I guess that public variables would be more efficient than hidden fields as they require more data to be stored (all the properties) and reading and writing to them requires a lot more processing. Public variables can be integers or dates etc whereas a hidden field will just store text. However a hidden field on a form is specific to that form and so there are fewer issues with naming (you'd have to give all your public variables different names).

I'd say do what is easiest to program.
 
Sounds like its public variables then. The code is quite time critical as it has to run in less than 100ms but there isn't a lot of code to process so I should be ok.

Thanks

Red
 

Users who are viewing this thread

Back
Top Bottom