Testers needed (benchmarking 'b64') (Miscellaneous)
> Okay, but I'm not sure why OW is so slow.
I could be wrong, but I think it's because of BUFSIZ being default of only 512 bytes for 16-bit code.
When I added two calls to setvbuf() using two char [16000] arrays, one for input and one for output, then it sped up. And I compiled with "wcl /otexan". Feel free to benchmark this too, if curious.
--- b64.c 2012-08-13 07:45:52 +0000
+++ b64_me.c 2012-08-18 20:17:32 +0000
@@ -215,6 +215,8 @@
#include <stdio.h>
#include <stdlib.h>
+static char my_inbuf[16000], my_outbuf[16000];
+
/*
** Translation Table as described in RFC1113
*/
@@ -400,6 +402,7 @@
}
else {
infile = fopen( infilename, "rb" );
+ setvbuf(infile,my_inbuf,_IOFBF,sizeof my_inbuf);
}
if( !infile ) {
perror( infilename );
@@ -411,6 +414,7 @@
}
else {
outfile = fopen( outfilename, "wb" );
+ setvbuf(outfile,my_outbuf,_IOFBF,sizeof my_outbuf);
}
if( !outfile ) {
perror( outfilename );
(clean boot)
C:\TMP\BLAH>runtime b64_me -e douay.txt me.out
03.41 seconds elapsed
C:\TMP\BLAH>runtime b64_ow -e douay.txt rr.out
10.77 seconds elapsed
Complete thread:
- Testers needed (benchmarking 'b64') - rr, 12.08.2012, 23:02 (Miscellaneous)
- Testers needed (benchmarking 'b64') - Rugxulo, 13.08.2012, 08:36
- Testers needed (benchmarking 'b64') - rr, 13.08.2012, 20:05
- Testers needed (benchmarking 'b64') - Rugxulo, 14.08.2012, 00:31
- Testers needed (benchmarking 'b64') - rr, 14.08.2012, 22:33
- Testers needed (benchmarking 'b64') - Rugxulo, 14.08.2012, 23:32
- Testers needed (benchmarking 'b64') - Rugxulo, 14.08.2012, 23:53
- Testers needed (benchmarking 'b64') - RayeR, 16.08.2012, 00:13
- Testers needed (benchmarking 'b64') - Rugxulo, 16.08.2012, 16:47
- Testers needed (benchmarking 'b64') - RayeR, 16.08.2012, 00:13
- Testers needed (benchmarking 'b64') - Rugxulo, 14.08.2012, 23:53
- Testers needed (benchmarking 'b64') - Rugxulo, 14.08.2012, 23:32
- Testers needed (benchmarking 'b64') - Rugxulo, 19.08.2012, 03:25
- Testers needed (benchmarking 'b64') - rr, 14.08.2012, 22:33
- Testers needed (benchmarking 'b64') - Rugxulo, 14.08.2012, 00:31
- Testers needed (benchmarking 'b64') - rr, 13.08.2012, 20:05
- Testers needed (benchmarking 'b64') - Japheth, 13.08.2012, 12:31
- Testers needed (benchmarking 'b64') - rr, 13.08.2012, 19:05
- Testers needed (benchmarking 'b64') - Japheth, 13.08.2012, 20:56
- Testers needed (benchmarking 'b64') - rr, 13.08.2012, 19:05
- Testers needed (benchmarking 'b64') - Khusraw, 13.08.2012, 15:17
- Testers needed (benchmarking 'b64') - Doug, 13.08.2012, 21:53
- Testers needed (benchmarking 'b64') - rr, 13.08.2012, 22:41
- Testers needed (benchmarking 'b64') - glennmcc, 14.08.2012, 02:05
- Testers needed (benchmarking 'b64') - rr, 21.08.2012, 11:46
- Testers needed (benchmarking 'b64') - Rugxulo, 13.08.2012, 08:36