commit | 98c6121ee5b7acff3b5477f50b7fcc6e198a4f82 | [log] [tgz] |
---|---|---|
author | Willy Tarreau <w@1wt.eu> | Sat Sep 10 20:08:49 2011 +0200 |
committer | Willy Tarreau <w@1wt.eu> | Sat Sep 10 20:08:49 2011 +0200 |
tree | 3ab18286f4cc352dbf8009fa614558aadaf10fa4 | |
parent | 576132e5336aa7011df021fc9409a07d73d646d3 [diff] |
[OPTIM] task: don't scan the run queue if we know it's empty It happens quite often in fact, so let's save those precious cycles.
diff --git a/src/task.c b/src/task.c index 9b21fd9..a054150 100644 --- a/src/task.c +++ b/src/task.c
@@ -196,6 +196,10 @@ run_queue_cur = run_queue; /* keep a copy for reporting */ nb_tasks_cur = nb_tasks; max_processed = run_queue; + + if (!run_queue) + return; + if (max_processed > 200) max_processed = 200;