Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[SR-13353] SIMD instructions slow: Calls to IndexingIterator.next() #55793

Open
fabianfett opened this issue Aug 6, 2020 · 3 comments
Open
Labels
bug A deviation from expected or documented behavior. Also: expected but undesirable behavior. performance simd standard library Area: Standard library umbrella

Comments

@fabianfett
Copy link
Member

Previous ID SR-13353
Radar rdar://problem/67001499
Original Reporter @fabianfett
Type Bug

Attachment: Download

Environment

Xcode: Version 12.0 beta 3 (12A8169g)

MacBook Pro (16-inch, 2019) - 2,4 GHz 8-Core Intel Core i9

Additional Detail from JIRA
Votes 0
Component/s Standard Library
Labels Bug, simd
Assignee None
Priority Medium

Watchers: @shahmishal

md5: a9b0f1c4918239714c91107417976ce1

Issue Description:

Today I've been toying around with `UUID`s. I wanted to see if I can write a fast Swift UUID parser (without Foundation). To achieve this I used the SIMD Swift instructions. Interestingly the performance was about 6times slower than using `uuid_parse` (from Darwin) and more than ten times slower compared to a simple parsing loop. (The code is attached)

Parsing UUIDs: 1000000
-----------------------------
uuid_parse | took: 0.39703s
Loop UUIDKit | took: 0.22107s
SIMD UUIDKit | took: 2.65504s
Foundation | took: 0.54979s

Looking into the performance with Instruments, I've found that there are a lot of calls to `specialized IndexingIterator.next()`. Maybe I'm missing something here, but I wonder why there is an `Iterator` in use?

I assume that this might be related to: https://bugs.swift.org/browse/SR-12777

If you have any questions please reach out. My technical skills (assembler and stuff) are limited though.

@swift-ci
Copy link
Collaborator

Comment by Kyle Macomber (JIRA)

@swift-ci create

@swift-ci
Copy link
Collaborator

Comment by Kyle Macomber (JIRA)

cc @stephentyrone

@shahmishal
Copy link
Member

@swift-ci create

@swift-ci swift-ci transferred this issue from apple/swift-issues Apr 25, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug A deviation from expected or documented behavior. Also: expected but undesirable behavior. performance simd standard library Area: Standard library umbrella
Projects
None yet
Development

No branches or pull requests

4 participants