Skip to content

Commit

Permalink
Merge pull request #10159 from JabRef/fix-performance
Browse files Browse the repository at this point in the history
Fix high CPU usage because of author name autocomplete
  • Loading branch information
Siedlerchr authored Aug 13, 2023
2 parents 2eacf33 + 203c956 commit d7e0ecc
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/main/java/org/jabref/model/entry/AuthorList.java
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
package org.jabref.model.entry;

import java.util.Collections;
import java.util.List;
import java.util.Map;
import java.util.Objects;
import java.util.WeakHashMap;
import java.util.function.Function;
Expand Down Expand Up @@ -115,7 +117,7 @@
@AllowedToUseLogic("because it needs access to AuthorList parser")
public class AuthorList {

private static final WeakHashMap<String, AuthorList> AUTHOR_CACHE = new WeakHashMap<>();
private static final Map<String, AuthorList> AUTHOR_CACHE = Collections.synchronizedMap(new WeakHashMap<>());
private final List<Author> authors;
private AuthorList latexFreeAuthors;

Expand Down

0 comments on commit d7e0ecc

Please sign in to comment.