shortDOI formatter is very slow #10589
Labels
dev: performance
good first issue
An issue intended for project-newcomers. Varies in difficulty.
[outdated] type: bug
Confirmed bugs or reports that are very likely to be bugs
In one of my libraries, which contains approx 100 DOI entries, having the shortDOI field formatter active noticeably slows down the time it takes to save the library.
It takes <1 second to save without said formatter, but 30-40 seconds with, during which JabRef becomes unresponsive. This happens on every save, even when all DOI fields are already in the shortDOI format.
jabref/src/main/java/org/jabref/logic/formatter/bibtexfields/ShortenDOIFormatter.java
Lines 28 to 40 in d6a0e59
jabref/src/main/java/org/jabref/logic/importer/util/ShortDOIService.java
Lines 30 to 35 in d6a0e59
If I interpret the above pieces of code correctly, the formatter always makes a request to the shortDOI service, even if the DOI is already shortened. Would it be possible to first check if the DOI is already shortened (i.e. starts with "10/"), and only make a request if it is not?
The text was updated successfully, but these errors were encountered: