mirror of
https://github.com/gnustep/libs-base.git
synced 2025-04-23 00:41:02 +00:00
Minor performance tweak.
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@21214 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
parent
b4a6c85cd8
commit
268c01362e
2 changed files with 13 additions and 4 deletions
|
@ -1,3 +1,11 @@
|
|||
2005-05-11 Richard Frith-Macdonald <rfm@gnu.org>
|
||||
|
||||
* 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 <rfm@gnu.org>
|
||||
|
||||
* Tools/AGSHtml.h:
|
||||
|
|
|
@ -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];
|
||||
/*
|
||||
|
|
Loading…
Reference in a new issue