Speedup of writing SDPA out