Juergen Spitzmueller wrote:
> This optimization is no more.

I don't have time to work on it in the foreseeable timeframe, but how about 
the following idea, that strikes me much better than the 1.3 optimization 
hack?

- make fillWithBibKeys a bool.
- make InsetBibtex::getFiles a map (or a vector/pair, dunno) instead of a 
vector which stores not only the file name, but also information about the 
state of the bibfiles. In this case, I think even the timestamp of the file 
would suffice. If not, I seem to remember someone mentioning that boost has 
some helpful functions.
- in insetbibtex::fillWithBibkeys, check if the bibfiles have changed (compare 
the status data of the file with the cached one). If the bibfile hasn't 
changed, let fillWithBibKeys return false and the vector stays just empty; if 
it has changed, parse the bibfiles, update the vector and return true.
- in insetcite, getNatbibLabel, use the cached keys if fillWithBibKeys returns 
false, else use the updated data.

This is just a theoretical scenario. The implementation could differ (I even 
do not know if this works), but anyway.

I imagine the advance of this approach not only to get rid of the slowness in 
scrolling/navigating when using natbib, but also in opening the dialog, 
because the dialog data would only be updated if really necessary. (you can 
imagine that with a bibfile of 2000 entries, this would be a real 
improvement).

What about this idea? I think it would be not very difficult to implement, and 
given the slowness I encounter with the paper I'm currently working on, I 
think it would be something that should go into branch ASAP. So if anyone 
feels like volunteering (or going for an alternative fix), please do so!

Jürgen

Reply via email to