# Optimized code debugging

**URL:** <https://ziggit.dev/t/optimized-code-debugging/6210>\
**Category:** Help\
**Tags:** debugger\
**Created:** [October 1, 2024, 12:57pm UTC](https://ziggit.dev/t/optimized-code-debugging/6210 "2024-10-01T12:57:49Z")\
**Posts on this page:** 1\
**Showing post:** 2

<div class="post-metadata">

**Author:** ![dimdin](https://ziggit.dev/user_avatar/ziggit.dev/dimdin/32/1457_2.png) [@dimdin](https://ziggit.dev/u/dimdin)\
**Post date:** [October 1, 2024, 1:16pm UTC](https://ziggit.dev/t/optimized-code-debugging/6210/2 "2024-10-01T13:16:12Z")

</div>

The mechanisms are:

1. [Atomics](https://ziglang.org/documentation/master/#Atomics)

```zig
const _var = @atomicLoad(@TypeOf(some_var), &some_var, .seq_cst);

```

2. [doNotOptimizeAway](https://ziglang.org/documentation/master/std/#std.mem.doNotOptimizeAway) See: [How to use std.mem.doNotOptimizeAway?](https://ziggit.dev/t/how-to-use-std-mem-donotoptimizeaway/4677)
3. [volatile](https://ziglang.org/documentation/master/#volatile) Note: [Benchmarking isDigit - #17 by andrewrk](https://ziggit.dev/t/benchmarking-isdigit/4604/17)

---

_[View the full topic](https://ziggit.dev/t/optimized-code-debugging/6210)._
