News:

MASM32 SDK Description, downloads and other helpful links
MASM32.com New Forum Link
masmforum WebSite

The Windows API

Started by 2-Bit Chip, September 13, 2009, 04:19:36 PM

Previous topic - Next topic

2-Bit Chip

Are the functions of the Windows API optimized for best performance or for reliability?

Are there alternatives avaliable: Like opening a file without using the winapi?

Jimg

Obviously the api is not optimized, or it would be written in assembly.

Why would one ever write a program that is not reliable?  It it doesn't work, it's a bug.  So there is no optimizing for reliability, only writing programs that work and those that don't.

There are no VIABLE alternatives for windows programming.

dedndave

in DOS days, or even win95/98 with FAT drives, it may have been easy
by the time you write the code to find a file on an NTFS drive, you'd be better off using the API
even then, you'd have to get into ring 0 i think
the API calls aren't "optimized" at all, from what i can see - lol
they are biased toward functionality
keep in mind, that files on a drive may be partially in cache or shared
you're better off letting the system determine what is shared - what is cached - what permissions are needed
reading and writing files seems pretty fast to me using the API

Astro

QuoteAre there alternatives avaliable: Like opening a file without using the winapi?
Why would you want to do that? ::)

Astro.

2-Bit Chip

The reason for me asking about alternatives is for speed.

Astro

Ahh - thought it might be for some other reason.

Astro.

BlackVortex

Well, winapi+cache management+hard disk's hardware cache and all that shiznit has pretty good performance actually.

If you want to improve upon it, then you can use your own virtual filesystem (kinda) , like steam's gcf files, which are big container files that contain thousands of files. The actual reading is kinda the same, but you can optimize the read/seek times, because you can stack the files exactly the way you want and make your own indexes and whatever.

I've no practical experience and I am simplifying it, but I hope you get the idea.

@ Astro : Your constant I-wannabe-a-cracker yapping has gotten tiring.

hutch--

If you are interfacing with the OS, use the OS functions, its the only reliable way to do it. If a normal OS function will do the job and its clean and simple to use, (not all of them are) then use it but if you need speed and can write the code reliably without the system's inbuilt SEH and other considerations that make it slower, write your own andd see the difference.
Download site for MASM32      New MASM Forum
https://masm32.com          https://masm32.com/board/index.php