Comment by pverghese 1 year ago Compared to Rust its blazingly fast. Compared to Go compilation its slower. 4 comments pverghese Reply metaltyphoon 1 year ago Non it’s not. I known its not a benchmark but just try a zig init and build their hello world. It takes significantly longer sweeter 1 year ago ```shsweet@nadeko ~ $ mkcd testsweet@nadeko ~/test $ zig initinfo: created build.ziginfo: created build.zig.zoninfo: created src/main.ziginfo: created src/root.ziginfo: see `zig build --help` for a menu of optionssweet@nadeko ~/test $ time zig buildzig build 5.08s user 0.58s system 119% cpu 4.745 total# cachedsweet@nadeko ~/test $ time zig buildzig build 0.01s user 0.03s system 132% cpu 0.026 total# after rewriting the main function to call a function that takes a pointer to another functionsweet@nadeko ~/test $ time zig buildzig build 0.02s user 0.03s system 136% cpu 0.032 total``` jedisct1 1 year ago The first time you run the toolchain for a given target, it compiles stuff that is then stored in a global cache. baazaa 1 year ago think this has something to do with zig building part of the std which other languages ship as binaries. incremental compilation will remove this small overhead.
metaltyphoon 1 year ago Non it’s not. I known its not a benchmark but just try a zig init and build their hello world. It takes significantly longer sweeter 1 year ago ```shsweet@nadeko ~ $ mkcd testsweet@nadeko ~/test $ zig initinfo: created build.ziginfo: created build.zig.zoninfo: created src/main.ziginfo: created src/root.ziginfo: see `zig build --help` for a menu of optionssweet@nadeko ~/test $ time zig buildzig build 5.08s user 0.58s system 119% cpu 4.745 total# cachedsweet@nadeko ~/test $ time zig buildzig build 0.01s user 0.03s system 132% cpu 0.026 total# after rewriting the main function to call a function that takes a pointer to another functionsweet@nadeko ~/test $ time zig buildzig build 0.02s user 0.03s system 136% cpu 0.032 total``` jedisct1 1 year ago The first time you run the toolchain for a given target, it compiles stuff that is then stored in a global cache. baazaa 1 year ago think this has something to do with zig building part of the std which other languages ship as binaries. incremental compilation will remove this small overhead.
sweeter 1 year ago ```shsweet@nadeko ~ $ mkcd testsweet@nadeko ~/test $ zig initinfo: created build.ziginfo: created build.zig.zoninfo: created src/main.ziginfo: created src/root.ziginfo: see `zig build --help` for a menu of optionssweet@nadeko ~/test $ time zig buildzig build 5.08s user 0.58s system 119% cpu 4.745 total# cachedsweet@nadeko ~/test $ time zig buildzig build 0.01s user 0.03s system 132% cpu 0.026 total# after rewriting the main function to call a function that takes a pointer to another functionsweet@nadeko ~/test $ time zig buildzig build 0.02s user 0.03s system 136% cpu 0.032 total```
jedisct1 1 year ago The first time you run the toolchain for a given target, it compiles stuff that is then stored in a global cache.
baazaa 1 year ago think this has something to do with zig building part of the std which other languages ship as binaries. incremental compilation will remove this small overhead.
Non it’s not. I known its not a benchmark but just try a zig init and build their hello world. It takes significantly longer
```sh
sweet@nadeko ~ $ mkcd test
sweet@nadeko ~/test $ zig init
info: created build.zig
info: created build.zig.zon
info: created src/main.zig
info: created src/root.zig
info: see `zig build --help` for a menu of options
sweet@nadeko ~/test $ time zig build
zig build 5.08s user 0.58s system 119% cpu 4.745 total
# cached
sweet@nadeko ~/test $ time zig build
zig build 0.01s user 0.03s system 132% cpu 0.026 total
# after rewriting the main function to call a function that takes a pointer to another function
sweet@nadeko ~/test $ time zig build
zig build 0.02s user 0.03s system 136% cpu 0.032 total
```
The first time you run the toolchain for a given target, it compiles stuff that is then stored in a global cache.
think this has something to do with zig building part of the std which other languages ship as binaries. incremental compilation will remove this small overhead.