Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Info
titleTest Performance

Fast tests are critical! Imagine the main test thread is a runner and he must complete a race. Sleeping or polling for that runner are viciously costly. All of the threads and resources around that runner should be clearing the way and reacting quickly and efficiently, so he can run from point a to b in the fastest way possible, with little blocking, or unnecessary waiting. A test will often have a storm of activity, but we must remember the key is that one runner. Of course when he completes, everything has to be ready and quickly close as well, but first thing is first.


Gradle

ZooKeeper

https://zookeeper.apache.org/

We must take care with our ZooKeeper usage. We want to minimize communication with ZooKeeper. We want to minimize clients to ZooKeeper, watches to ZooKeeper and requests to ZooKeeper. We especially do not want to poll ZooKeeper but instead rely on watchers.

We should use the right types of calls for the right situations:

standard request: We should consider a single request to ZooKeeper expensive in most cases. Prefer to be efficient rather than relying on extra sugar requests we don't need.

async api: This is good for some bulk operations - it's relatively fast because you can send off many payloads without waiting for a response until they are all sent.

multi api: This is known to be the fastest api but also a little thickier with handling responses properly. It also only succeeds if all of the individual operations succeed. You can use a multi to only write data if a certain znode has a given version as another use case.

Apache Solr Reference Guide

...