---
title: optimizationLevel
framework: metal
role: symbol
role_heading: Instance Property
path: metal/mtlcompileoptions/optimizationlevel
---

# optimizationLevel

An option that tells the compiler what to prioritize when it compiles Metal shader code.

## Declaration

```swift
var optimizationLevel: MTLLibraryOptimizationLevel { get set }
```

## Mentioned in

Minimizing the binary size of a shader library

## See Also

### Configuring the compiler options

- [enableLogging](metal/mtlcompileoptions/enablelogging.md)
- [mathMode](metal/mtlcompileoptions/mathmode.md)
- [mathFloatingPointFunctions](metal/mtlcompileoptions/mathfloatingpointfunctions.md)
- [preserveInvariance](metal/mtlcompileoptions/preserveinvariance.md)
- [languageVersion](metal/mtlcompileoptions/languageversion.md)
- [preprocessorMacros](metal/mtlcompileoptions/preprocessormacros.md)
- [libraries](metal/mtlcompileoptions/libraries.md)
- [fastMathEnabled](metal/mtlcompileoptions/fastmathenabled.md)
