schema/gen/go: batch file writes via a bytes.Buffer
With this change, running 'go generate ./...' on the entire module while running gopls on one of its files drops gopls's CPU spinning from ~25s to well under a second. They should improve that anyway, but there's no reason for the tens of thousands of tiny FS writes on our end either. The time to run 'go generate ./...' itself is largely unaffected; it goes from ~1.2s to ~1.1s, judging by a handful of runs.
Showing
Please register or sign in to comment