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

Optimize namespace-aliases #328

Merged
merged 1 commit into from
Sep 17, 2021
Merged

Optimize namespace-aliases #328

merged 1 commit into from
Sep 17, 2021

Conversation

vemv
Copy link
Member

@vemv vemv commented Sep 16, 2021

Optimizes this defn via 3 techniques:

  • Consolidates the common work to be done across :clj / :cljs dialects
  • Parallelizes the work, per dialect
  • and shrinks the corpus by removing non source/test dirs from the classpath.
    • (this is the most important gain for small/medium projects)

Testing it over refactor-nrepl itself, I got a performance gain from 70ms (cached case) to 20ms (cached case).

The performance gains can be larger as projects scale. It also can plausibly ameliorate the mistery slowness for the :cljs branch.

Fixes #230 (see #230 (comment))

@vemv vemv mentioned this pull request Sep 16, 2021
Copy link
Member

@expez expez left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for another great PR, @vemv! ❤️

[:cljs (util/with-suppressed-errors
(some-fn core/cljs-file? core/cljc-file?)
ignore-errors?)]]
(repeat files))]
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is very elegant! 👍

Parallelizes it, and shrinks the corpus by removing non source/test dirs from the classpath.

Testing it over refactor-nrepl itself, I got a performance gain from 70ms (cached case) to 20ms (cached case).

The performance gains can be larger as projects scale. It also can plausibly ameliorate the mistery slowness for the :cljs branch.
@vemv vemv force-pushed the optimize-namespace-aliases branch from a99c08d to 7722c0e Compare September 17, 2021 09:51
@vemv
Copy link
Member Author

vemv commented Sep 17, 2021

Cheers 🍻 thanks for the eyeing! Getting closer to a new release 🚀

@vemv vemv merged commit 1399da2 into master Sep 17, 2021
@vemv vemv deleted the optimize-namespace-aliases branch September 17, 2021 10:04
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.

cljr-slash is very slow
2 participants