Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Improve performance of semantic indentation by caching rules#76

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Conversation

@rrudakov
Copy link
Contributor

I've noticed that reindenting big file is pretty slow, profiler report indicated that the bottleneck is the calculation of combined indentation rules from default settings and user customizations:

(seq-union (or rules clojure-ts-semantic-indent-rules)             clojure-ts--semantic-indent-rules-defaults             (lambda (e1e2) (equal (car e1) (car e2))))

this is called every time we need to calculate indentation for a single line.

This PR introduces buffer local variableclojure-ts--semantic-indent-rules-cache which stores pre-calculated rules. This variable is set whenclojure-ts-mode is activated and updated every time whenclojure-ts-semantic-indent-rules is updated or file local variables are updated (in case when indentation rules are defined in.dir-locals.el for example.


Before submitting a PR mark the checkboxes for the items you've done (if you
think a checkbox does not apply, then leave it unchecked):

  • You've runM-x checkdoc and fixed any warnings in the code you've written.
  • You've updated the changelog (if adding/changing user-visible functionality).
  • You've updated the readme (if adding/changing user-visible functionality).

Thanks!

@rrudakovrrudakovforce-pushed thefeature/semantic-indentation-performance-improvements branch 2 times, most recently fromd76c16f to9dff9d1CompareApril 9, 2025 19:46
@rrudakovrrudakovforce-pushed thefeature/semantic-indentation-performance-improvements branch from9dff9d1 tob57f024CompareApril 10, 2025 07:00
@rrudakovrrudakov requested a review frombbatsovApril 10, 2025 07:00
@bbatsovbbatsov merged commit897659a intoclojure-emacs:mainApr 10, 2025
2 of 3 checks passed
@rrudakovrrudakov deleted the feature/semantic-indentation-performance-improvements branchApril 10, 2025 08:15
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment

Reviewers

@bbatsovbbatsovbbatsov approved these changes

Assignees

No one assigned

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

2 participants

@rrudakov@bbatsov

[8]ページ先頭

©2009-2025 Movatter.jp