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

Lazy load ffap. #2215

Closed
wants to merge 2 commits into from
Closed

Lazy load ffap. #2215

wants to merge 2 commits into from

Conversation

mookid
Copy link
Contributor

@mookid mookid commented Aug 24, 2019

find-file-at-point is a heavyweight dependency (in terms of load
time), which is rarely used. It happens to pop near the top of the
slowest packages to load when benchmarking my config, because of the
(require 'ffap) in ivy.

This commit delays the load when needed.

find-file-at-point is a heavyweight dependency (in terms of load
time), which is rarely used. It happens to pop near the top of the
slowest packages to load when benchmarking my config, because of the
(require 'ffap) in ivy.

This commit delays the load when needed.
@mookid
Copy link
Contributor Author

mookid commented Aug 24, 2019

The test is a bit nasty, but it should either be run first in an ert session (can't be enforced without hacks) or in a separate process.

@abo-abo
Copy link
Owner

abo-abo commented Aug 25, 2019

Thanks, merged with some rewrites:

  • In ivy.el, I like to have declare-function etc, close to the place where it's needed, so that it can be removed later if needed. Also easier to see the context with iedit.
  • In ivy-test.el, I don't want to call Emacs twice, we achieve it with ert-run-tests-batch.
  • For Emacs 24.3, there's no advice-add so I rewrote it to defadvice.

Please review.

abo-abo added a commit that referenced this pull request Aug 25, 2019
@abo-abo
Copy link
Owner

abo-abo commented Aug 25, 2019

This patch uncovered some strangeness in the tests for Emacs 24.5. I've silenced them for now, before I investigate further.

abo-abo added a commit that referenced this pull request Aug 25, 2019
The reason why they were failing is that they require `ivy-mode' to be
on, and ERT runs tests in a random order. So previously these tests
were not failing because a previous test turned `ivy-mode' on.

Fixes #2215
@mookid
Copy link
Contributor Author

mookid commented Aug 25, 2019

@abo-abo looks good to me.

The failure looks weird indeed.

astoff pushed a commit to astoff/swiper that referenced this pull request Jan 1, 2021
find-file-at-point is a heavyweight dependency (in terms of load
time), which is rarely used. It happens to pop near the top of the
slowest packages to load when benchmarking my config, because of the
(require 'ffap) in ivy.

This commit delays the load when needed.

Fixes abo-abo#2215
astoff pushed a commit to astoff/swiper that referenced this pull request Jan 1, 2021
astoff pushed a commit to astoff/swiper that referenced this pull request Jan 1, 2021
The reason why they were failing is that they require `ivy-mode' to be
on, and ERT runs tests in a random order. So previously these tests
were not failing because a previous test turned `ivy-mode' on.

Fixes abo-abo#2215
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.

None yet

2 participants