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

Ability to turn off JSON pretty printing and sorting of keys for better performance #710

Closed
nikolaikrill opened this issue Sep 26, 2021 · 0 comments · Fixed by #712
Closed

Comments

@nikolaikrill
Copy link

SourceKitten can be quite slow in printing large number of code completion results. For example when importing Foundation:

sourcekitten complete --text $'import Foundation\n' --offset 18 -- -sdk macosx

On my machine, this example takes about 1.7 seconds. I've discovered that most of this is due to pretty printing and sorting of the JSON results, which is arguably unneccessary in most cases.

Rebuilding sourcekitten without the [.prettyPrinted, .sortedKeys] options in JSONOutput.swift reduces the runtime of the above command to 0.92 seconds, a significant improvement.

Please add an option to disable these printing modes. Thanks!

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 a pull request may close this issue.

1 participant