-
-
Notifications
You must be signed in to change notification settings - Fork 3.2k
Still another array access performance issue (in debug) #15685
Copy link
Copy link
Closed
Labels
bugObserved behavior contradicts documented or intended behaviorObserved behavior contradicts documented or intended behavioroptimizationregressionIt worked in a previous version of Zig, but stopped working.It worked in a previous version of Zig, but stopped working.
Milestone
Description
Activity
Metadata
Metadata
Assignees
Labels
bugObserved behavior contradicts documented or intended behaviorObserved behavior contradicts documented or intended behavioroptimizationregressionIt worked in a previous version of Zig, but stopped working.It worked in a previous version of Zig, but stopped working.
Type
Projects
- StatusShow more project fieldsOptimize Machine Code
Zig Version
0.11.0-dev.3105+e46d7a369
Steps to Reproduce and Observed Behavior
This is a follow-up to #13938 which was only fixed in release mode(which means I still have to rely on the workaround to be able to run my code in debug mode). The reproduction code is basically identical:
Running this in debug mode is taking 93 ms for iterating over a 32768 element array:
Running this in a profiler, I can see that the bottleneck still is a


memcpythat is called once every iteration and appears to be copying the entire array:Expected Behavior
When applying the workaround
the performance is significantly better, taking only 0.4 ms instead of 93 ms: