7 ms·
Zig Performance Tracking Dashboard
- robochat42 5y agoNice plots, they seem to be svg and link directly to the appropriate github commits if to click on a particular point. I wonder if they were coded by hand or if a plotting library was involved.
- dgellow 5y agoYou can look at the source, the script is quite clean: https://ziglang.org/perf/perf.js https://ziglang.org/perf/perf.js. It is using D3.js.
- jackhalford 5y agoThis is great, visibility makes the zig developers accountable and gives a clear incentive not to regress. Does anyone know of similar projects from other languages?
- Pazzaz 5y agoRust has https://perf.rust-lang.org/ https://perf.rust-lang.org/
- pornel 5y agoI know of https://perf.rust-lang.org https://perf.rust-lang.org It's integrated with the bors bot, so pull requests can be measured and prevented from merging if they regress. Additionally, this data is manually analyzed, and gets weekly reports like this: https://github.com/rust-lang/rustc-perf/blob/master/triage/2021-11-30.md https://github.com/rust-lang/rustc-perf/blob/master/triage/2...
- deleted 5y ago[deleted]
- turminal 5y agoArguably, zig is not yet at the point where they should care very much about performance regressions.
- speed_spread 5y agoZig is very much a performance language, so it would make sense to track that metric from the get go (haha).
- Leherenn 5y agoThey should care, though they probably have more leeway to drop performance for the right trade off since they are not stable yet.
- nrclark 5y agoZig is growing fast, and the dev team should feel proud of what they're building. I think it's great to see metrics like this because they demonstrate an attention to detail that will be necessary for Zig's success. Metrics help ensure that Zig will stay high-performance as it moves to its self-hosted compiler, which is underway right now.
- kristoff_it 5y agoexcellent compilation speed is one of the main goals of the self-hosted compiler, which is what is being developed right now, so it makes total sense to track related metrics
- AndyKelley 5y agollvm: http://llvm-compile-time-tracker.com/ http://llvm-compile-time-tracker.com/
- xvilka 5y agoThey seem to be almost ready to make a new 0.9.0 release, by the way: https://github.com/ziglang/zig/milestone/11 https://github.com/ziglang/zig/milestone/11
- ksec 5y ago>I've been mainly focusing on preparing for the upcoming 0.9.0 release (Dec 20th) but I did manage to sneak in a couple self-hosted compiler improvements: Behavior Tests: - LLVM backend: 431/1071 (40%) pass - C backend: 205/1071 (19%) pass - ARM,x86,WASM: 0/1071 ( 0%) pass https://twitter.com/andy_kelley/status/1467652028159561728 https://twitter.com/andy_kelley/status/1467652028159561728
- kello 5y agoCan someone give me an elevator-pitch for Zig? When would I use it? Is it worth checking out in 2021?
- enriquto 5y ago> Can someone give me an elevator-pitch for Zig? The main page ziglang.com makes a good job at that: A simple language: * No hidden control flow. * No hidden memory allocations. * No preprocessor, no macros. Compile time goodness: * Call any function at compile-time. * Manipulate types as values without runtime overhead. * Comptime emulates the target architecture. Close to C and C++: * Use Zig as a zero-dependency, drop-in C/C++ compiler that supports cross-compilation out-of-the-box. * Add a Zig compilation unit to C/C++ projects; cross-language LTO is enabled by default.
- woodrowbarlow 5y agocomptime is hard to grasp from that blurb. for c programmers, here's a good example: you know how gcc will usually optimize `memcpy(dest, src, strlen("hello"))` to just `memcpy(dest, src, 5)` -- because it knows how strlen works, and in this case all the inputs are known at compile time? well, in zig, if a function is pure and all of its inputs are known at compile time, the compiler will always run the function at compile time and replace the function call with the result. you can also add the keyword `comptime` to force this behavior on a per-statement basis. so comptime gives you conditional compilation and also results in more optimized code. coupled with zig's import system, this eliminates the need for a preprocessor. perhaps more interestingly: even types can be comptimed... which gives you generics 'for free'. edit: removed inaccurate assumption regarding qemu
- ifreund 5y ago> it actually builds a stub program and runs it in qemu for your target arch That's not at all how the implementation works, the zig compiler does not depend on qemu. The comptime evaluation works much more like evaluating an interpreted language such as python.
- fwsgonzo 5y agoDoes Zig support SIMD now?
- deleted 5y ago[deleted]
- AndyKelley 5y agoSIMD support is almost complete. The documentation is still lacking, and some functions are still missing.
- rickstanley 5y agoI remember Vlang[0], I wonder how they are doing and if it's comparable to Zig, in terms of performance. [0]: https://github.com/vlang/v https://github.com/vlang/v
- Shadonototra 5y agothey delivered on their promises meanwhile zig still isn't self hosted both projects are interesting, i feel the later gets way too much credits compared to V
- renox 5y agoZig seems more complex than V due to its "compile time" execution, so I'm not surprised that it takes longer to write a "self-hosted" compiler. V seems more general purpose, Zig is focused on embedded which makes it more difficult to use IMHO: any V function can allocate but in Zig you have to pass around the allocator..
- nyberg 5y agoZig is general purpose and isn't really focused on embedded as much as it's focused on being flexible enough to also support embedded development. Configurable allocators are present in other languages (iirc rust allows it at the crate level, in C++ https://en.cppreference.com/w/cpp/memory/allocator https://en.cppreference.com/w/cpp/memory/allocator) but in zig the style makes allocating functions explicit which is nice even for regular application development. It's a bit like Haskell being explicit about side-effects (IO Monad, Eff, etc). Also, passing the allocator in zig is just a convention and not enforced by the compiler so you could use `std.heap.page_allocator` or any other global allocator anywhere in your code without passing it in but then your code is less flexible. Now for the use of the, imagine you need to serve a HTTP request; you pass an ArenaAllocator to the request handler which can allocate memory by need and without a need for calling free() for small objects. Once the handler has generated a response, the caller can free up all of the allocated memory in one step rather than having small deallocations all over for memory that will only have a life-time for the duration of the request. The handler itself doesn't need to know that it's being used this way and can be written to call free in the usual manner to be compatible with other allocators (free() with ArenaAllocator is a "nop"). Imagine you have a game, there you'll likely allocate a huge chunk at the start for all of your resources then use your own custom allocators within to both isolate systems from one another along with allowing different strategies based on your usecase. You might not always know which compiler will be best but since it's a parameter you can easily test or even decide at runtime on the strategy to use.