message: Rewrite the handling of threads==1, so it's a little more readable, and gets compiled with -O3 in a way that puts this case at the start of the function instead of at the end, which for a mysterious reason results in more stable performance.
diff: @@ -155,7 +155,13 @@ class Thread {
  void ThreadPool::ExecuteImpl(int task_count, int stride, Task* tasks) {
  RUY_DCHECK_GE(task_count, 1);
  - if (task_count > 1) {
  +
  + // Case of 1 thread: just run the single task on the current thread.
  + if (task_count == 1) {
  + (tasks + 0)->Run();
  + return;
  + }
  +
  // Task #0 will be run on the current thread.
  CreateThreads(task_count - 1);
  counter_to_decrement_when_ready_.Reset(task_count - 1);
  @@ -163,16 +169,13 @@ void ThreadPool::ExecuteImpl(int task_count, int stride, Task* tasks) {
  auto task_address = reinterpret_cast<std::uintptr_t>(tasks) + i * stride;
  threads_[i - 1]->StartWork(reinterpret_cast<Task*>(task_address));
  }
  - }
  // Execute task #0 immediately on the current thread.
  (tasks + 0)->Run();
  - if (task_count > 1) {
  // Wait for the threads submitted above to finish.
  counter_to_decrement_when_ready_.Wait();
  }
  -}
  // Ensures that the pool has at least the given count of threads.
  // If any new thread has to be created, this function waits for it to
  