---
title: "Discussion on \"Swift Performance: Stop Creating Intermediate Arrays with .lazy\" | Hashnode"
description: "Discussion on \"Swift Performance: Stop Creating Intermediate Arrays with .lazy\". so what happens when we write this code\nstruct User {\n    let name: String\n    let isActive: Bool\n    let avatarURL: URL\n}\n\nfunc search(query: String, in users: [User]) -> [UserRow] {\n    Array("
url: "https://hashnode.com/posts/swift-performance-stop-creating-intermediate-arrays-with-lazy/69c11cf0545ab963126fb6e6"
---

[Feed](https://hashnode.com/feed) /

Discussion

# [Swift Performance: Stop Creating Intermediate Arrays with .lazy](https://hudaios.hashnode.dev/swift-performance-stop-creating-intermediate-arrays-with-lazy?utm_source=hashnode&utm_medium=feed)

so what happens when we write this code struct User { let name: String let isActive: Bool let avatarURL: URL } func search(query: String, in users: \[User\]) -> \[UserRow\] { Array(

Mar 23 · 2 min read · hudaios.hashnode.dev  
Read the article

-   [#lazy](https://hashnode.com/tag/lazy)
-   [#swift](https://hashnode.com/tag/swift)
-   [#performance](https://hashnode.com/tag/performance)
-   [#lazysequence](https://hashnode.com/tag/lazysequence)
-   [#collections](https://hashnode.com/tag/collections)
-   [#lazyevaluation](https://hashnode.com/tag/lazyevaluation)

## Written by

[huda elhady](https://hashnode.com/@huda_elhady)

@huda\_elhady

  
[View profile](https://hashnode.com/@huda_elhady)

iOS Developer

## Responses

Markdown supported · ⌘↵ to post

No responses yet.
