Skip to content

Conversation

@jpsim
Copy link
Collaborator

@jpsim jpsim commented Feb 20, 2023

Using the new SourceKitten async send support introduced in jpsim/SourceKitten#762.

Using the new SourceKitten async send support introduced in
jpsim/SourceKitten#762.
@jpsim
Copy link
Collaborator Author

jpsim commented Feb 20, 2023

I expect this to perform much worse than main right now because we're now using multiple caches for SourceKit editor-open requests. For more realistic performance numbers I'd need to get rid of the previous synchronous cache completely and migrate everything over.

@SwiftLintBot
Copy link

2 Warnings
⚠️ Big PR
⚠️ If this is a user-facing change, please include a CHANGELOG entry to credit yourself!
You can find it at CHANGELOG.md.
18 Messages
📖 Linting Aerial with this PR took 2.17s vs 1.07s on main (102% slower)
📖 Linting Alamofire with this PR took 2.79s vs 1.35s on main (106% slower)
📖 Linting Brave with this PR took 19.02s vs 7.32s on main (159% slower)
📖 Linting DuckDuckGo with this PR took 6.92s vs 3.04s on main (127% slower)
📖 Linting Firefox with this PR took 19.12s vs 9.28s on main (106% slower)
📖 Linting Kickstarter with this PR took 24.99s vs 10.22s on main (144% slower)
📖 Linting Moya with this PR took 1.02s vs 0.53s on main (92% slower)
📖 Linting NetNewsWire with this PR took 7.05s vs 3.06s on main (130% slower)
📖 Linting Nimble with this PR took 1.26s vs 0.59s on main (113% slower)
📖 Linting PocketCasts with this PR took 16.45s vs 7.13s on main (130% slower)
📖 Linting Quick with this PR took 0.45s vs 0.23s on main (95% slower)
📖 Linting Realm with this PR took 11.48s vs 11.54s on main (0% faster)
📖 Linting SourceKitten with this PR took 0.91s vs 0.44s on main (106% slower)
📖 Linting Sourcery with this PR took 4.51s vs 2.19s on main (105% slower)
📖 Linting Swift with this PR took 10.01s vs 4.5s on main (122% slower)
📖 Linting VLC with this PR took 3.33s vs 1.34s on main (148% slower)
📖 Linting Wire with this PR took 22.01s vs 8.3s on main (165% slower)
📖 Linting WordPress with this PR took 34.46s vs 11.02s on main (212% slower)

Here's an example of your CHANGELOG entry:

* Proof-of-concept: Async Rules.  
  [jpsim](https://github.com/jpsim)
  [#issue_number](https://github.com/realm/SwiftLint/issues/issue_number)

note: There are two invisible spaces after the entry's text.

Generated by 🚫 Danger

@lo1tuma
Copy link
Contributor

lo1tuma commented Mar 3, 2023

What would be the use-case for an async rule?

@jpsim
Copy link
Collaborator Author

jpsim commented Mar 3, 2023

The use case is the same as synchronous rules, but might perform better. For example I measured tests running significantly faster, though linting real projects was slower. Needs tuning and might not work.

@lo1tuma
Copy link
Contributor

lo1tuma commented Mar 3, 2023

Ah thanks for the explanation. Better performance would be nice to have. My naive thinking was that it would be enough for the rule runner to by async and parallelize the execution of synchronous rules. But I’m still a swift newbie and don’t know the concurrency model in detail yet.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants