kabiroberai / node-swift

Create Node modules in Swift
MIT License
492 stars 16 forks source link

Building example takes a long time, every time #40

Closed jameshfisher closed 1 month ago

jameshfisher commented 1 month ago
npm exec node-swift  215.15s user 23.28s system 140% cpu 2:49.33 total

Most of the time is spent in

[26/33] Compiling NodeModuleSupport register.m
kabiroberai commented 1 month ago

The SwiftPM output is misleading, I believe it actually spends most of its time compiling swift-syntax (which is a known upstream issue.)

The fact that it's slow every time is because we do a clean release build by default (which is something I've considered changing, open to input.) You can speed up subsequent builds a ton by instead running npx node-swift build.

jameshfisher commented 1 month ago

Sorry, yes, build is a bajillion times faster than rebuild! I'd make that the default, although I'm not sure of the tradeoffs. Thanks for your help!