[2005] Alternative options for storage
I am currently working on a project that maintains multiple DataTables in memory right now. Most of them are bound/linked to controls on form(s). Obviously the more I have, the more memory/resources that they take up, the more the applications performance is decreased.
My question is this, what other alternatives can be used that are "secure", will allow quick and easy access, and will help boost performance? I have considered using Application Settings, but am unsure if they are stored in memory or on hard disk. I know that they can be relatively secure as well. The downside is that these tables and such do not need to be kept after the program is shut down.
These are other options I have explored:
- Local db file - messy and unstable...
- Local text file(s) - too many and they would be recoverable after the program quits or if it quits unexpectedly.
- Registry - too much data to store there, some tables have several hundred rows.
Thanks for the input!!
D
Re: [2005] Alternative options for storage
Your app performance decrease is unlikely to be linked to the number of tables you have in memory unless your memory is seriously low. Many front-end business apps would maintain dozens of tables, some of them quite extensive, yet nobody seriously worries about the number of tables (at least I have never heard anybody fret over that number).
From the sound of it, the way you have it is the only way to go, and if performance is deteriorating, you need to look at how the slower parts of the app are being implemented. Of the options you listed, only the DB option sounds plausible to me, but since you talk about not needing persistance, and not really wanting any lingering disc fingerprint, then even a DB is not all that good an option.
Re: [2005] Alternative options for storage
Most of the time, performance is entirely how you code things.
If you know exactly where your performance issues are though, try recoding them exploring different methods. It's amazing the performance gain from things like ListViews by using .AddRange() instead of .Add() in a loop. What would take 3 minutes takes 2 seconds.
Check out the ANTS Profiler by RedGate if you're really concerned about performance and where your bottlenecks are. It's very good and very easy to use. I highly recommend it. It's essentially stopwatching every line of your code and showing you in a quick-chart where the hot-spots are.