Performance of topological codes for quantum error correction