---
title: "lucene2.3.2与2.2.0建索引的速度比较"
author: "coderplay"
date: "2008-07-29T22:42:02Z"
tags: []
slug: "lucene2-3-2-2-2-0"
draft: false
lastmod: "2008-07-29T22:42:02Z"
id: 221316
url: "https://coderplay.iteye.com/blog/221316"
---

文本材料大小: 43.9 MB  
文件数目: 19997个  
分析器:    lucene标准StandardAnalyzer

lucene-2.2.0  
索引大小: 16,901,638 字节  
耗时:  
158094 total milliseconds  
110437 total milliseconds  
106328 total milliseconds

lucene-2.3.2  
索引大小: 16,177,772字节  
默认16M缓存耗时:  
15407 total milliseconds  
15500 total milliseconds  
设置64M缓存耗时:  
13578 total milliseconds  
13984 total milliseconds  
13359 total milliseconds  
15500 total milliseconds

 

可以看出2.3比2.2建索引的速度要快5~10倍。原理请看2.2的DocumentWriter和2.3的DocumentsWriter.

2.3采用in-memory模型。