which is faster in Wine? WinApi functions such as: CreateFile(), ReadFile(), WriteFile(), CloseFile(), HeapAlloc(), HeapRealloc(), etc. vs. C Runtime functions: fopen(), fread(), fwrite, fclose(), malloc(), etc. if i develop an application to be run in Wine, should i use WinApi functions, or C Runtime functions?
If you are using pure C runtime you really need to consider if you should be using wine at all. There are more and more ways to go native. Currently C runtime ways are faster. Mostly because optimisation has not been done on CreateFile() and the like instead they just wrap to fopen() and so on in glibc. Wrapping has a price. Sorry to say the exact other way to windows. Its one place wine is a mirror image. If you go the C runtime path you will take a hit on windows. If you go the WinAPI path you take a hit on wine.
oiaohm wrote:> If you are using pure C runtime you really need to consider if you should be using wine at all. There are more and more ways to go native. > > Currently C runtime ways are faster. Mostly because optimisation has not been done on CreateFile() and the like instead they just wrap to fopen() and so on in glibc. Wrapping has a price. > > Sorry to say the exact other way to windows. Its one place wine is a mirror image. If you go the C runtime path you will take a hit on windows. If you go the WinAPI path you take a hit on wine.It really depends on what this application is going to be doing and how often. Could be a case of premature optimization.