Skip to content

Help wanted: Improving performance when repeatedly creating a one-entry bibliography #40

@halirutan

Description

@halirutan

In JabRef, we use

CSL.makeAdhocBibliography(style, outputFormat.getFormat(), cslItemData);

to create the HTML-preview for the currently selected item in the BibTeX database. Every time the user scrolls through the main list, we update the preview and call this code again. I have carefully profiled what happens, but everything points to this call being the source of our memory and performance problems. I know that makeAdhocBibliography has a clear warning sign in its comments that it will be expensive.

Can you recommend the best possible way to handle our situation so that it is as resource-friendly as possible? We have the following constants and variables:

  • the style is set in the preferences and stays constant most of the time
  • the output format is fixed as well
  • we provide the cslItemData every time the preview needs to be updated

I'm asking this question because at the moment I see no sensible way with one of the built-in ItemDataProviders to achieve this. Therefore, one of my first questions would be: Is it OK to make an ItemDataProvider that changes its content? I would then initialize a CSL instance with an empty provider and change its underlying ItemData list every time we need to render an item.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions