You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Deque implements a custom iterator that's supposed to be faster than just going through integer indices, but in actual benchmarks it turns out be slower. Either fix it to be faster, or if that cannot be done, just revert to the standard IndexingIterator.
Information
Package version: release/1.1
Platform version: macOS 13
Swift version: Swift 5.7
Checklist
If possible, I've reproduced the issue using the main branch of this package.
Run the upcoming Deque benchmarks, and look at the results.
self.add(
title:"Deque<Int> sequential iteration (contiguous, iterator)",
input:[Int].self
){ input inletdeque=Deque(input)return{ timer in
for i in deque {blackHole(i)}}}self.add(
title:"Deque<Int> sequential iteration (discontiguous, iterator)",
input:[Int].self
){ input inletdeque=Deque(discontiguous: input)return{ timer in
for i in deque {blackHole(i)}}}self.add(
title:"Deque<Int> sequential iteration (contiguous, indices)",
input:[Int].self
){ input inletdeque=Deque(input)return{ timer in
for i in deque.indices {blackHole(deque[i])}}}self.add(
title:"Deque<Int> sequential iteration (discontiguous, indices)",
input:[Int].self
){ input inletdeque=Deque(discontiguous: input)return{ timer in
for i in deque.indices {blackHole(deque[i])}}}
Expected behavior
I expected Deque.Iterator to be at least slightly faster than simply indexing from 0 to count.
Actual behavior
The text was updated successfully, but these errors were encountered:
Deque
implements a custom iterator that's supposed to be faster than just going through integer indices, but in actual benchmarks it turns out be slower. Either fix it to be faster, or if that cannot be done, just revert to the standardIndexingIterator
.Information
Checklist
main
branch of this package.Steps to Reproduce
Run the upcoming Deque benchmarks, and look at the results.
Expected behavior
I expected
Deque.Iterator
to be at least slightly faster than simply indexing from0
tocount
.Actual behavior
The text was updated successfully, but these errors were encountered: