rinari icon indicating copy to clipboard operation
rinari copied to clipboard

rinari-find-* cache

Open chalmagean opened this issue 12 years ago • 13 comments

I am working on a few large projects and doing rinari-find- on almost anything (rspec, controller, etc) takes a very long time. Is there a caching option hidden somewhere ?

chalmagean avatar Jun 28 '12 13:06 chalmagean

There's no caching option, and I can't immediately see how a reliable caching mechanism could be added. How large are the projects? And are you on a platform with a very slow disk or filesystem (e.g. Windows)?

-Steve

purcell avatar Sep 01 '12 14:09 purcell

a large project is around 2000 files

chalmagean avatar Sep 01 '12 15:09 chalmagean

Yeah, that's a few files. This is probably an issue for the jump.el project, which rinari uses. I believe it first finds all files in the project dir, then filters them according to the jump rules, so perhaps it can be modified to only search certain directories.

purcell avatar Sep 02 '12 11:09 purcell

I don't really mind the initial find, it's just that I would expect a caching mechanism to be in place so I don't have to wait each time I do a search. I'll take a look at jump.el, maybe I can figure out something.

chalmagean avatar Sep 02 '12 13:09 chalmagean

As the saying goes, the hard thing to figure out would be when to invalidate the cache.

purcell avatar Sep 03 '12 20:09 purcell

That's not hard at all, manually would be just fine (or on each session). That's how CTRLP works (in vim).

chalmagean avatar Sep 04 '12 06:09 chalmagean

Well, I mean it's very hard if you want to make it work correctly without manual intervention.

An intermediate step would be caching everything but invalidating the cache when creating / editing / deleting files from within Emacs.

BTW, if you have Emacs 24, you can enable recentf with a very high value for recentf-max-saved-items, say 4000. Then, if you enable ido-use-virtual-buffers, you can just use ido's buffer switching to switch back to previously-visited buffers by name, even if they are no longer open. I habitually use this technique, because it works in non-rinari projects too.

purcell avatar Sep 04 '12 10:09 purcell

I need my find to be specific to the current rails project and not have any file I've edited as a result since I constantly switch projects, open gems, edit emacs files etc. So I need a precise jump, and a fast one.

chalmagean avatar Sep 04 '12 10:09 chalmagean

Understandable. Just sharing tips.

purcell avatar Sep 04 '12 10:09 purcell

There's a projectile which has got file caching mechanism. Rinari would have to depend on it. It's easy to get files from subdirectories of the project root and invalidate cache. Just adding my 3 cents to the discussion.

asok avatar Oct 15 '12 09:10 asok

I've tested projectile and it works pretty well. It also has relative paths on the file names which makes it pretty readable (if you have ido separate matches on separate lines).

chalmagean avatar Mar 14 '13 10:03 chalmagean

Given enough time, I might well look into replacing the jump code with a dependency on projectile.

purcell avatar Mar 14 '13 11:03 purcell

I think that's a step in the right direction given the fact that projectile is actively maintained and it's author is very responsive.

chalmagean avatar Mar 14 '13 11:03 chalmagean