Kevin A. Burton wrote:
It looks like Document.java uses its own implementation of a LinkedList..

Why not use a HashMap to enable O(1) lookup... right now field lookup is O(N) which is certainly no fun.

Was this benchmarked? Perhaps theres the assumption that since documents often have few fields the object overhead and hashcode overhead would have been less this way.

I have never benchmarked this but would be surprised if it makes a measureable difference in any real application. A linked list is used because it naturally supports multiple entries with the same key. A home-grown linked list was used because, when Lucene was first written, java.util.LinkedList did not exist.


Please feel free to benchmark this against a HashMap of LinkedList of Field. This would be slower to construct, which may offset any increased access speed.

Doug

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Reply via email to