ziglang/ziglang.org
14
29
Fork
You've already forked ziglang.org
31

Regression in Zig/C comparison #431

Open
opened 2024年12月24日 20:45:48 +01:00 by vegerot · 3 comments
vegerot commented 2024年12月24日 20:45:48 +01:00 (Migrated from github.com)
Copy link

The website mentions this comparison between C and Zig.

In more recent versions, while Zig still uses faster instructions, it actually uses one more instruction which makes the comparison look less cool.

Of course it's just doing some stack management which is way faster than an imul, but just thought it was worth pointing out :)

https://godbolt.org/z/qWGvEo9o6

The website mentions [this](https://godbolt.org/z/n_nLEU) comparison between C and Zig. In more recent versions, while Zig still uses _faster_ instructions, it actually uses [one more instruction](https://godbolt.org/z/qWGvEo9o6) which makes the comparison look less cool. Of course it's just doing some stack management which is way faster than an `imul`, but just thought it was worth pointing out :) https://godbolt.org/z/qWGvEo9o6

What page is this on?

What page is this on?
vegerot commented 2025年05月13日 01:32:58 +02:00 (Migrated from github.com)
Copy link

This used to be on the overview, but looks like it was moved to old github.com/ziglang/www.ziglang.org@eb96ef0b76/old-content/learn/overview.en.md (L60)

This used to be on the overview, but looks like it was moved to old https://github.com/ziglang/www.ziglang.org/blob/eb96ef0b7656400404e531204694aac60a81ad11/old-content/learn/overview.en.md?plain=1#L60
bronze1man commented 2025年07月13日 13:40:33 +02:00 (Migrated from github.com)
Copy link

https://godbolt.org/z/fab14rvM9
zig 0.13.0 only have three lines:

half:
 mov eax, edi
 shr eax
 ret
https://godbolt.org/z/fab14rvM9 zig 0.13.0 only have three lines: ``` half: mov eax, edi shr eax ret ```
Sign in to join this conversation.
No Branch/Tag specified
main
release-0.16.0
apraga/french
homersimpsons/fix/mobile-responsiveness
MarkLagodych/patch-1
Zirunis/patch-1
zmitchell/zmitchell/build-graph-docs
generalmimon/fix-unit-testing-examples
generalmimon/fix-code-snippet-in-0.15.1-relnotes
TheConnorJohnson/main
meeting-minutes
enkvadrat/update-curl-example
No results found.
Labels
Clear labels
bounty
https://ziglang.org/news/announcing-donor-bounties
bug
Observed behavior contradicts documented or intended behavior.
contributor-friendly
This issue is limited in scope and/or knowledge of project internals.
downstream
An issue with a third-party project that uses this project.
enhancement
Solving this issue will likely involve adding new logic or components to the codebase.
infra
An issue related to project infrastructure, e.g. continuous integration.
optimization
A task to improve performance and/or resource usage.
question
No questions on the issue tracker; use a community space instead.
regression
Something that used to work in a previous version stopped working
upstream
An issue with a third-party project that this project uses.
use case
Describes a real use case that is difficult or impossible, but does not propose a solution.
Milestone
Clear milestone
No items
No milestone
Projects
Clear projects
No items
No project
Assignees
Clear assignees
No assignees
2 participants
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
ziglang/ziglang.org#431
Reference in a new issue
ziglang/ziglang.org
No description provided.
Delete branch "%!s()"

Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?