Advertisement
2_2002-2004 Files/ File Controls/ Input/ Output #114632

Faster-than-API .Ini Manipulation Class

According to feedback by several PSC'ers, this module is blowing away API .Ini calls speedwise. After I originally submitted it I became curious just how much faster the API calls were than my class in accessing .Ini files because I assumed APIs are always faster. So I found a millisecond timer class, and added that and an old API .Ini class that I had gotten from who knows where. I merged them into this project and ran some tests. I read somewhere on PSC that the API calls ran "at least 50 times faster" than pure VB equivalents (I can't remember who posted that comment). I had never doubted that remark because you can't beat APIs for speed (compared to pure VB). Then I ran some tests and saw that my class ran 18 times slower than the API class. I started tweaking my code and ended up with the screen shot you see below. These times are for an ancient 500 mHz Win98 machine. Many people with newer systems are reporting my class is MUCH faster than the API calls. I could shave a few dozen more milliseconds off these times by inlining more code but enough is enough. This was just a fun project to do and I thought some people here might be interested in these comparisons. I learned some code optimization techniques out of this project, anyway. If you spot any errors please let me know. Thanks.

AI

KI-Zusammenfassung: This codebase represents a historical implementation of the logic described in the metadata. Our preservation engine analyzes the structure to provide context for modern developers.

Quellcode
original-source
Upload
Originalkommentare (3)
Wiederhergestellt von der Wayback Machine