<!--
{
  "availability" : [
    "iOS: 16.0.0 -",
    "iPadOS: 16.0.0 -",
    "macCatalyst: 16.0.0 -",
    "macOS: 13.0.0 -",
    "tvOS: 16.0.0 -",
    "visionOS: 1.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "Metal",
  "identifier" : "/documentation/Metal/MTLLibraryOptimizationLevel/size",
  "metadataVersion" : "0.1.0",
  "role" : "Case",
  "symbol" : {
    "kind" : "Case",
    "modules" : [
      "Metal"
    ],
    "preciseIdentifier" : "c:@E@MTLLibraryOptimizationLevel@MTLLibraryOptimizationLevelSize"
  },
  "title" : "MTLLibraryOptimizationLevel.size"
}
-->

# MTLLibraryOptimizationLevel.size

An optimization option for the Metal compiler that prioritizes minimizing the size of its output binaries, which may also reduce compile time.

```
case size
```

## Discussion

This option is similar to [`MTLLibraryOptimizationLevel.default`](/documentation/Metal/MTLLibraryOptimizationLevel/default), but adds optimizations that prioritize minimizing a shader’s executable size, which may also reduce compile time.

---

Copyright &copy; 2026 Apple Inc. All rights reserved. | [Terms of Use](https://www.apple.com/legal/internet-services/terms/site.html) | [Privacy Policy](https://www.apple.com/privacy/privacy-policy)