[solved] fopen() / FOpen() speed comparison
Posted: Wed Jun 10, 2015 8:28 am
Hi,
I'm looking for the best solution to copy files and tested FOpen, FRead, FWrite, FClose DOS method but it is very slower than fopen, fread, fwrite, fclose.
Of course, I tested on the same file with the same BUFSIZ (1024).
1) Is the speed difference normal ?
See below for samples/results.
2) Is fopen() callable in a Process ?
I tried but always encounter a DSI in fopen(). For the same Process call, FOpen() works well.
Samples :
In the following samples, I test to write a file (SYS:Internet/OWB/OWB) in RAM: and measures the elapsed time thanks to "timer" os4depot program.
Binaries and sources :
http://zzd10h.amiga-ng.org/Divers/FOpen_test.lha
FOpen DOS :
timer FOpen_DOS SYS:Internet/OWB/OWB RAM:
source = (SYS:Internet/OWB/OWB) dest = (RAM:)
starting copying
Copy complete
Command duration: 1.1491 sec.
fopen stdio :
timer FOpen_stdio SYS:Internet/OWB/OWB RAM:
source = (SYS:Internet/OWB/OWB) dest = (RAM:)
nom_fichier_source=SYS:Internet/OWB/OWB RAM:OWB
starting copying
Copy complete
Command duration: 0.1138 sec.
I obtain the same difference (stdio fopen is far more fast than DOS FOpen method) for all files than I tested and for all buffer size.
3) Is the FOpen() method that I use not efficient ?
Thank you very much for your advices and replies on these 3 points.
Guillaume
I'm looking for the best solution to copy files and tested FOpen, FRead, FWrite, FClose DOS method but it is very slower than fopen, fread, fwrite, fclose.
Of course, I tested on the same file with the same BUFSIZ (1024).
1) Is the speed difference normal ?
See below for samples/results.
2) Is fopen() callable in a Process ?
I tried but always encounter a DSI in fopen(). For the same Process call, FOpen() works well.
Samples :
In the following samples, I test to write a file (SYS:Internet/OWB/OWB) in RAM: and measures the elapsed time thanks to "timer" os4depot program.
Binaries and sources :
http://zzd10h.amiga-ng.org/Divers/FOpen_test.lha
FOpen DOS :
timer FOpen_DOS SYS:Internet/OWB/OWB RAM:
source = (SYS:Internet/OWB/OWB) dest = (RAM:)
starting copying
Copy complete
Command duration: 1.1491 sec.
fopen stdio :
timer FOpen_stdio SYS:Internet/OWB/OWB RAM:
source = (SYS:Internet/OWB/OWB) dest = (RAM:)
nom_fichier_source=SYS:Internet/OWB/OWB RAM:OWB
starting copying
Copy complete
Command duration: 0.1138 sec.
I obtain the same difference (stdio fopen is far more fast than DOS FOpen method) for all files than I tested and for all buffer size.
3) Is the FOpen() method that I use not efficient ?
Thank you very much for your advices and replies on these 3 points.
Guillaume