TorchScript's graph optimization, achieved through JIT compilation of Python code, focuses on reducing Python overhead and enabling operator fusion. In contrast, TensorFlow's XLA (Accelerated Linear Algebra) compiler provides more aggressive, graph-level fusion and hardware-specific optimizations, particularly for Google TPUs, sometimes offering a slight edge in high-throughput production scenarios at very large scales.