Mitigating Log Cost through Non-Volatile Memory and Checkpoint Optimization