lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Aviran" <>
Subject Are synchronized objects necessary in FieldInfos
Date Thu, 08 Jul 2004 19:21:27 GMT
Hi all,
First let me explain what I found out. I'm running Lucene on a 4 CPU server.
While doing some stress tests I've noticed that searching threads are
blocked on the method: public FieldInfo fieldInfo(int fieldNumber)
This causes for a significant cpu idle time. I noticed that the class
org.apache.lucene.index.FieldInfos uses private class members Vector
byNumber and Hashtable byName, both of which are synchronized objects. By
changing the Vector byNumber to ArrayList byNumber I was able to get 110%
improvement in performance (number of searches per second).
My question is: do the fields byNumber and byName have to be synchronized
and what can happen if I'll change them to be ArrayList and HashMap which
are not synchronized ?

  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message