# Async iteration over lines of a file is surprising slow

**URL:** <https://forums.swift.org/t/async-iteration-over-lines-of-a-file-is-surprising-slow/66244>\
**Category:** Using Swift\
**Tags:** concurrency, performance, asyncsequence, asynciterator\
**Created:** [July 19, 2023, 2:02am UTC](https://forums.swift.org/t/async-iteration-over-lines-of-a-file-is-surprising-slow/66244 "2023-07-19T02:02:28Z")\
**Posts on this page:** 1\
**Showing post:** 12

<div class="post-metadata">

**Author:** ![David\_Smith](https://sea2.discourse-cdn.com/swift/user_avatar/forums.swift.org/david_smith/32/37508_2.png) [@David\_Smith](https://forums.swift.org/u/David_Smith)\
**Post date:** [July 19, 2023, 11:21pm UTC](https://forums.swift.org/t/async-iteration-over-lines-of-a-file-is-surprising-slow/66244/12 "2023-07-19T23:21:01Z")

</div>

As mentioned in the other thread ([Why is Regex slower than using a bunch of String.contains? - #16 by David\_Smith](https://forums.swift.org/t/why-is-regex-slower-than-using-a-bunch-of-string-contains/66247/16)), I found a few things that look suboptimal here in async line iteration and filed a bug to investigate improving it.

---

_[View the full topic](https://forums.swift.org/t/async-iteration-over-lines-of-a-file-is-surprising-slow/66244)._
