Skip to content

[Don't Merge] Migrate FallthroughRule to SwiftSyntax - #2480

Closed
jpsim wants to merge 5 commits into
masterfrom
fallthrough-swift-syntax-2
Closed

jpsim wants to merge 5 commits into
masterfrom
fallthrough-swift-syntax-2

Conversation

@jpsim

@jpsim jpsim commented Nov 24, 2018

Copy link
Copy Markdown
Collaborator

This is a follow-up to #2476 but using SourceKitten's syntaxTree request instead of invoking the swiftc process for each file.

Early results are promising but it's still significantly slower than the current non-SwiftSyntax implementation:

image

Lots of time is being spent in JSON decoding, so SwiftSyntax's upcoming byte tree deserializer should help bridge the remaining performance gap.

image

@SwiftLintBot

SwiftLintBot commented Nov 24, 2018 •

Copy link
Copy Markdown
14 Warnings
⚠️ Big PR
⚠️ Please include a CHANGELOG entry to credit yourself!
You can find it at CHANGELOG.md.
⚠️ This PR changed the exit value when running on Aerial: (pid 4342 exit 2 to pid 3144 SIGABRT (signal 6))
⚠️ This PR changed the exit value when running on Alamofire: (pid 4361 exit 2 to pid 3160 SIGABRT (signal 6))
⚠️ This PR changed the exit value when running on Firefox: (pid 4378 exit 2 to pid 3175 SIGABRT (signal 6))
⚠️ This PR changed the exit value when running on Kickstarter: (pid 4401 exit 2 to pid 3190 SIGABRT (signal 6))
⚠️ This PR changed the exit value when running on Moya: (pid 4433 exit 2 to pid 3209 SIGABRT (signal 6))
⚠️ This PR changed the exit value when running on Nimble: (pid 4448 exit 2 to pid 3224 SIGABRT (signal 6))
⚠️ This PR changed the exit value when running on Quick: (pid 4465 exit 2 to pid 3239 SIGABRT (signal 6))
⚠️ This PR changed the exit value when running on Realm: (pid 4480 exit 2 to pid 3254 SIGABRT (signal 6))
⚠️ This PR changed the exit value when running on SourceKitten: (pid 4497 exit 2 to pid 3269 SIGABRT (signal 6))
⚠️ This PR changed the exit value when running on Sourcery: (pid 4516 exit 2 to pid 3284 SIGABRT (signal 6))
⚠️ This PR changed the exit value when running on Swift: (pid 4533 exit 2 to pid 3299 SIGABRT (signal 6))
⚠️ This PR changed the exit value when running on WordPress: (pid 4570 exit 2 to pid 3314 SIGABRT (signal 6))
12 Messages
📖 Linting Aerial with this PR took 0.21s vs 1.9s on master (88% faster)
📖 Linting Alamofire with this PR took 0.13s vs 3.75s on master (96% faster)
📖 Linting Firefox with this PR took 0.45s vs 14.02s on master (96% faster)
📖 Linting Kickstarter with this PR took 0.47s vs 21.33s on master (97% faster)
📖 Linting Moya with this PR took 0.13s vs 2.14s on master (93% faster)
📖 Linting Nimble with this PR took 0.15s vs 1.88s on master (92% faster)
📖 Linting Quick with this PR took 0.12s vs 0.61s on master (80% faster)
📖 Linting Realm with this PR took 0.19s vs 3.83s on master (95% faster)
📖 Linting SourceKitten with this PR took 0.13s vs 1.24s on master (89% faster)
📖 Linting Sourcery with this PR took 0.2s vs 5.03s on master (96% faster)
📖 Linting Swift with this PR took 0.36s vs 30.42s on master (98% faster)
📖 Linting WordPress with this PR took 0.52s vs 21.78s on master (97% faster)

Here's an example of your CHANGELOG entry:

* [Don't Merge] Migrate FallthroughRule to SwiftSyntax.  
  [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

@jpsim
jpsim force-pushed the fallthrough-swift-syntax-2 branch from 0c0078d to fe112d6 Compare November 25, 2018 07:22
@jpsim

jpsim commented Nov 25, 2018

Copy link
Copy Markdown
Collaborator Author

Byte tree deserialization made this fast enough to consider using.

image

@jpsim
jpsim force-pushed the fallthrough-swift-syntax-2 branch from 32cecf5 to 61066c4 Compare November 28, 2018 19:52
@Jeehut

Jeehut commented Feb 25, 2019

Copy link
Copy Markdown
Collaborator

@jpsim What do you think, should we consider adding a SwiftSyntax based base rule type to the project now that Swift 5 will be released soon (I'm assuming that the byte tree deserialization will be part of the new release of SwiftSyntax) and start refactoring the first rules to it? Or do you have other ideas on how we can improve performance and correctness long term? (I know it's not the fastest yet, but I'm assuming performance will improve over time.)

@marcelofabri

Copy link
Copy Markdown
Collaborator

I'm assuming that the byte tree deserialization will be part of the new release of SwiftSyntax

IIRC this won't be a part of 5.0

@stale

stale Bot commented Nov 8, 2020

Copy link
Copy Markdown

This issue has been automatically marked as stale because it has not had any recent activity. Please comment to prevent this issue from being closed. Thank you for your contributions!

@stale stale Bot added the wontfix Issues that became stale and were auto-closed by a bot. label Nov 8, 2020
@stale stale Bot closed this Nov 15, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

wontfix Issues that became stale and were auto-closed by a bot.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants