diff --git a/ChangeLog b/ChangeLog index b08367f1e..89d8e38e5 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,11 @@ +2005-05-11 Richard Frith-Macdonald + + * Source/GSFileHandle.m: Increase size of buffer for incoming data ... + on modern systems we have more memory and a bugger buffer can make + a significant performance improvement when reading large amounts of + streamed data. New define of READ_SIZE for this buffer ... easily + adjusted in one place. + 2005-05-10 Richard Frith-Macdonald * Tools/AGSHtml.h: diff --git a/Source/GSFileHandle.m b/Source/GSFileHandle.m index b07bb27e4..899eea846 100644 --- a/Source/GSFileHandle.m +++ b/Source/GSFileHandle.m @@ -101,6 +101,7 @@ // Maximum data in single I/O operation #define NETBUF_SIZE 4096 +#define READ_SIZE NETBUF_SIZE*10 static GSFileHandle* fh_stdin = nil; static GSFileHandle* fh_stdout = nil; @@ -1381,7 +1382,7 @@ NSString * const GSSOCKSRecvAddr = @"GSSOCKSRecvAddr"; - (NSData*) availableData { - char buf[NETBUF_SIZE]; + char buf[READ_SIZE]; NSMutableData* d; int len; @@ -1417,7 +1418,7 @@ NSString * const GSSOCKSRecvAddr = @"GSSOCKSRecvAddr"; - (NSData*) readDataToEndOfFile { - char buf[NETBUF_SIZE]; + char buf[READ_SIZE]; NSMutableData* d; int len; @@ -1467,7 +1468,7 @@ NSString * const GSSOCKSRecvAddr = @"GSSOCKSRecvAddr"; } else { - char buf[NETBUF_SIZE]; + char buf[READ_SIZE]; d = [NSMutableData dataWithCapacity: 0]; do @@ -2151,7 +2152,7 @@ NSString * const GSSOCKSRecvAddr = @"GSSOCKSRecvAddr"; NSMutableData *item; int length; int received = 0; - char buf[NETBUF_SIZE]; + char buf[READ_SIZE]; item = [readInfo objectForKey: NSFileHandleNotificationDataItem]; /*