# Sema: fix performance regression · gitcafe/zig

[View on GitCafe](https://git.cafe/gitcafe/zig/commit/2b677d1660018434757f9c9efec3c712675e6c47)

Repository: [gitcafe/zig](https://git.cafe/gitcafe/zig)

Visibility: public

Requested revision: 2b677d1660018434757f9c9efec3c712675e6c47

Requested commit: 2b677d1660018434757f9c9efec3c712675e6c47

Commit: 2b677d1660018434757f9c9efec3c712675e6c47

Tree: b0c05ac895e1e42abca677a135caf34d15173d24

Author: mlugg

Committer: mlugg

## Message

```
Sema: fix performance regression

LLVM fails to notice that in release builds, `logFn` ignores its
arguments, so their computation can be elided. So, LLVM fails to elide
this hashmap lookup. Its cost isn't too significant, but doing it in the
hottest loop in Sema adds up!

Technically, we could do the lookup a single time, before the loop, but
it was cleanest (and a little faster) to just disable this log call at
comptime when debug logging is disabled.

```

## Parents

- [6a8cf25a8aea11ef80b48c9bce59d0aafcff3297](https://git.cafe/gitcafe/zig/commit/6a8cf25a8aea11ef80b48c9bce59d0aafcff3297?format=markdown)

[Source at this commit](https://git.cafe/gitcafe/zig/tree/2b677d1660018434757f9c9efec3c712675e6c47?format=markdown)
