From 047a08747102685e7212981f7cd446bd5c9f5dfa Mon Sep 17 00:00:00 2001 From: Craig Macdonald Date: Wed, 8 Jan 2025 12:17:16 +0000 Subject: [PATCH] less synchronization --- .../structures/concurrent/ConcurrentDocumentIndex.java | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/modules/concurrent/src/main/java/org/terrier/structures/concurrent/ConcurrentDocumentIndex.java b/modules/concurrent/src/main/java/org/terrier/structures/concurrent/ConcurrentDocumentIndex.java index b4511c09..0f81dc57 100644 --- a/modules/concurrent/src/main/java/org/terrier/structures/concurrent/ConcurrentDocumentIndex.java +++ b/modules/concurrent/src/main/java/org/terrier/structures/concurrent/ConcurrentDocumentIndex.java @@ -47,9 +47,8 @@ public DocumentIndexEntry getDocumentEntry(int docid) throws IOException { } public int getDocumentLength(int docid) throws IOException { - synchronized (parent) { - return parent.getDocumentLength(docid); - } + // we dont synchronize on getDocumentLength() - we assume this is always in memory and reentrant + return parent.getDocumentLength(docid); } public int getNumberOfDocuments() {