# getenvW: Take advantage of sliceTo/indexOfScalarPos optimizations · gitcafe/zig

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

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

Visibility: public

Requested revision: 66dcebcc76d41b125e9c6de9fecd61a8b3a272da

Requested commit: 66dcebcc76d41b125e9c6de9fecd61a8b3a272da

Commit: 66dcebcc76d41b125e9c6de9fecd61a8b3a272da

Tree: bf361e49b7d84a0692d8ae8d6b3c6bf0548eaf33

Author: Ryan Liptak

Committer: Ryan Liptak

## Message

```
getenvW: Take advantage of sliceTo/indexOfScalarPos optimizations

Both sliceTo and indexOfScalarPos use SIMD when available to speed up the search. On my x86_64 machine, this leads to getenvW being around 2-3x faster overall.

Additionally, any future improvements to sliceTo/indexOfScalarPos will benefit getenvW.

```

## Parents

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

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