Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix high CPU usage because of author name autocomplete #10159

Merged
merged 2 commits into from
Aug 13, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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