# Sema: optimize comptime @memset by setting all elements at once · gitcafe/zig

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

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

Visibility: public

Requested revision: e011c31ee8e49bda4052ac9b74d088667dc310ba

Requested commit: e011c31ee8e49bda4052ac9b74d088667dc310ba

Commit: e011c31ee8e49bda4052ac9b74d088667dc310ba

Tree: c93088472d3871c3054aeefad72a3957d96b0c6c

Author: mlugg

Committer: Andrew Kelley

## Message

```
Sema: optimize comptime @memset by setting all elements at once

Previously, @memset at comptime performed N pointer stores. This is less
efficient than just storing a whole array of values at once. The
difference can be quite drastic when reinterpreting memory - a test case
which is 40s on master branch now takes under a second on a debug
compiler build.

Resolves: #17214

```

## Parents

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

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