Latency is the time it takes to perform some action and produce some result. Throughput is the amount of actions that can be performed in some time frame. The general rule of thumb is to optimize such that you maximize throughput with having acceptable latency.