Comments (9)
OK, thanks much! That's what I see.
Not terrible, but I'd like performance to be consistently very good to excellent.
If you see the linked PR, I've figured out what causes this, but not yet why, or what can be done about it.
from citar.
@wenjie2wang can you please see here?
It should be working here.
from citar.
Thanks for your quick response! FYI, my bib file is available at https://gitlab.com/wenjie2wang/bibrary/-/raw/master/bib/index.bib.
from citar.
OK, thanks.
I think I actually know what's going on. Will check in a bit.
from citar.
I just loaded your file, and every time I load a command, there's a pause, but it's certainly less than a second.
What do you mean by "noticeable time"?
from citar.
That said, I do think we've identified a performance bottleneck, that when fixed should address this.
from citar.
I just loaded your file, and every time I load a command, there's a pause, but it's certainly less than a second.
What do you mean by "noticeable time"?
Thanks, @bdarcus ! This is what I mean by "noticeable time". There is always a noticeable pause after M-x bibtex-actions-open
. In contrast, M-x ivy-bibtex
is able to respond instantly after the first run. I made a gif for your reference.
from citar.
I've been digging into this (doing benchmarking and profiling), and I can't see an obvious way to improve this on my end without unnecessary complexity. But I do see that a simple change in bibtex-completion could address this.
The situation
We have two functions that generate this UI:
bibtex-completion-candidates
: this one is cached, and is fastbibtex-actions--get-candidates
: this one is not cached, and is slower, because it transform 1 to do the display formatting
Because of how completing-read is designed, I need 2, though, because it doesn't have any notion of display transformers as in helm and ivy. So there is no distinction in completing-read between searching/filtering and display.
So part of the problem is intrinsic to completing-read.
The other part is that bibtex-completion-candidates
is designed around the above feature that is in helm and ivy, but not in completing-read.
Proposed solution
Ideally, however, I'd be able to replace the candidate strings in bibtex-completion-candidates
, with the output of bibtex-actions--get-candidates
. That would allow all of the display data to be cached, and so address the pause you note.
@tmalsburg - would it be possible to add a hook to bibtex-completion (a la the sort of thing you see in org-mode) that would allow me to specify a different function to generate that string? Something like:
(add-hook 'bibtex-completion-candidates-hook #'bibtex-actions--format-candidate)
If yes, that would be a simple and elegant solution to this issue.
Edit: per below, however, I decided to add my own cache.
Conclusion
In the end, I don't think the slight delay is a deal breaker, but would ideally like to address it, without myself having to write my own caching code.
PS - I have tried different ways to speed up bibtex-actions--get-candidates
, but none have an appreciable difference, so I don't think that's a promising path. It's basically fast enough, even for very large libraries, so long as we can activate caching on it.
from citar.
I've opened a linked pr that adds a cache. A hook could still be useful, but if this works, it's a small enough addition that I'm happy to merge it.
from citar.
Related Issues (20)
- Customizable `citar-add-file-to-library` HOT 3
- Display transform function for full names HOT 15
- Alignment doesn't work with star in template HOT 1
- Misaligned completion suggestions with company mode HOT 2
- citar--format-candidates docstring confusion
- The Homepage button on melpa leads to a 404 HOT 5
- Installing citar with guix: "Symbol's value as variable is void: citar-indicator-create" HOT 7
- citeproc: add way to specify output format
- Citar fails to display files containing commas HOT 5
- Feature request: Allow `citar` to add multiple files to library item/citeky via `citar-add-file-to-library` HOT 1
- `citar-open-entry` receives wrong citekey HOT 6
- modularizing citar--select-multiple HOT 2
- citar functions to act on buffers HOT 6
- (How to?) add a direct call to `citar-file-open-external` from citar's "menu"
- Problems rendering superscripts correctly for in-text citations when exporting to ODT HOT 3
- Make citar-open more configurable HOT 9
- Issues with `citar-export-local-bib-file` HOT 8
- embark-related parsing problems when multiple citekeys HOT 14
- Add org-mode markup to citar-insert-reference HOT 1
- Batch Note Insertion in Citar HOT 5
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from citar.