Any interest for an INI class wrapper?

cincyreds

Member
Joined
Dec 3, 2004
Messages
15
Location
New York
(NOTE - I just realized I was in the wrong forum when I posted this. If a mod could move this to the I/O section that would probably be more appropriate- thanks).

Im writing an app which currently uses the registry for storing program data.
Unfortunately the amount of data which needs to be stored can easily exceed the limits for keys, values, etc. so I need to go with a file based system for storage.

In keeping with the .NET "mindset" I originally planned to use XML config files, etc., but after looking at some of the overhead and hoops that need to be jumped through just to save/retrieve simple settings, I now think that INI files would offer a better solution (the app is time sensitive so I want data retrieval to be as quick as possible).

I plan on writing a 100% managed code class for INI file manipulation. Ive found only one on the web, but it was quite basic and not very well written. All the others use API calls which Id like to avoid.

Does anyone have a robust 100% managed code INI file class? If so, could you post a link?

If not, is there anyone interested in a managed code INI file class? If so, Ill post it here when complete.

BTW, this would be written in VB.NET.

Cheers,

Dean
 
Last edited by a moderator:
cincyreds said:
In keeping with the .NET "mindset" I originally planned to use XML config files, etc., but after looking at some of the overhead and hoops that need to be jumped through just to save/retrieve simple settings, I now think that INI files would offer a better solution (the app is time sensitive so I want data retrieval to be as quick as possible).

If you change your mind about xml you might want to check out this. I havent used (because I deal with XML a lot and write my own routines) it but its a good read.

With the .Net classes for dealing with XML I think itd be easier to do this in XML than to completely invent an INI handler, but thats just my opinion.

Microsoft has produced a number of "Application Blocks" for a number of topics, including saving and loading application data. You might want to check out their Configuration Application Block for use or inspiration. Its too bloated for my tastes but it does deal with a variety of ways of handling settings and their application block code can be interesting to review.

Cheers,
Paul
 
Thanks for the quick reply and link.

Seeing as you deal with XML a lot, whats your opinion about the following:

My app is a task scheduler that runs in the system tray. When it comes time to check for any events that need to be fired, it parses the list of scheduled events and retrieves the pertinent info for each event. This involves accessing anywhere from 5 to 20 individual settings for each event depending on its status, etc.

My concern is speed and overhead. I want the loop that checks these events to be as tight as possible. If I have to access the hard drive a few hundred times then this can become critical - especially in a timing application where its critical not to miss events.

Memory consumption is also a concern. Ive taken great pains to make this app as memory efficient as possible and right now when idling it runs on a low priority thread in only 800k of memory. I dont want to keep large chunks of data cached, etc. Currently the program pulls in what it needs to only when it needs to, then releases it immediately after. No extra classes, references, strings, etc. hanging around.

It just ***seemed*** that XML involved more overhead which might result in slow performance especially in cases where I might only need to read one value.

That being said, how do you find the performance of XML in terms of speed, overhead and memory consumption?

For my situation, the RETRIEVAL speed is more critical than the WRITING speed. Most major writing is done only when the user manually saves or updates a new task. Any other writing is only 2 or 3 values to update its status, etc.

As well, there are LOTS of places where I code reading and writing. Id hate to have to specify overly long function calls with long parameter lists just to write a single value. I wrote a registry class wrapper that optimizes everything so function calls are short and sweet without having to re-specify sections and keys that are being reused.

Thanks for your time!

:)

Dean
 
I deal with quite a bit of Xml but Im not Xml efficiency expert. I have had similar thoughts regarding the efficiency of xml objects compared to other I/O but in my experience the stuff seems ridiculously fast. I often deal with 20,000+ characters at a time from webservice feeds or files and I never notice any kind of load lag.

So, I imagine with a relatively small file you really wouldnt notice any speed or memory issues.

Id imagine the experts here could provide better info and/or you might find some performance stats online somewhere.

Good luck,
Paul
 

Similar threads

H
Replies
0
Views
146
Helpin-In-The-90s
H
V
Replies
0
Views
146
Vaishfacer
V
B
Replies
0
Views
587
Bryan Prendergast
B
Back
Top