top | item 45533240

(no title)

alain_gilbert | 4 months ago

I have a fairly small go project (100k loc) and it takes ~30sec to build.

I'd be thrilled to have it build in 300ms.

(Using a macbook pro 2019)

discuss

order

lenkite|4 months ago

That's strange. Humongous k8s Go projects (>500k LOC) build in a third of that time. Do you have lots of deps in your `go.mod` ? Is the project abusing codegen ?

alain_gilbert|4 months ago

61 dependencies, no codegen. Nothing special really.

Orygin|4 months ago

On a Macbook M2 Pro, on a project with loads of services, 210k loc, a full rebuild takes 70 seconds. Incremental takes 36s. For one service, full rebuild in 16s and incremental 0.6s. It's not blazing fast but considering the scale of the project, it's not that bad, especially since I rarely rebuild every service at the same time.

nicoburns|4 months ago

Consider upgrading your hardware if/when you get a chance to (obviously this is expensive). My builds (Rust not Go, but it might well be similar?) got 10x faster when I upgraded from a 2015 MBP to an M1. I suspect 2019 to M4 might be similar.

littlestymaar|4 months ago

> I have a fairly small go project (100k loc) and it takes ~30sec to build.

Wait, aren't Go builds supposed to be fast?

yencabulator|4 months ago

Are you using CGo? C compilation slowness doesn't count.