Skip to content

Commit

Permalink
reduce number of outstanding execute calls with minimal performance p…
Browse files Browse the repository at this point in the history
…enalty of 4%
  • Loading branch information
gnachman committed Mar 10, 2014
1 parent 964a88d commit 192564e
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion PTYSession.m
Expand Up @@ -225,7 +225,7 @@ - (id)init {

// Experimentally, this is enough to keep the queue primed but not overwhelmed.
// TODO: How do slower machines fare?
static const int kMaxOutstandingExecuteCalls = 8;
static const int kMaxOutstandingExecuteCalls = 4;
_executionSemaphore = dispatch_semaphore_create(kMaxOutstandingExecuteCalls);

_lastOutput = _lastInput;
Expand Down
4 changes: 2 additions & 2 deletions tests/spam.cc
Expand Up @@ -24,13 +24,13 @@ void setline(char* s, int n) {
int main(int argc, char*argv[]) {
int n;
if (argc == 1) {
n = 1000000;
n = 20000;
} else {
n = atoi(argv[1]);
}
cm = argc==3;
for (int i = 0; n < 0 || i < n; ++i) {
char buffer[100];
char buffer[10000];
setline(buffer, sizeof(buffer)-1);
printf("%s\n", buffer);
}
Expand Down

0 comments on commit 192564e

Please sign in to comment.